thoughts about fanotify and HSM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jan,

I wanted to consult with you about preliminary design thoughts
for implementing a hierarchical storage manager (HSM)
with fanotify.

I have been in contact with some developers in the past
who were interested in using fanotify to implement HSM
(to replace old DMAPI implementation).

Basically, FAN_OPEN_PERM + FAN_MARK_FILESYSTEM
should be enough to implement a basic HSM, but it is not
sufficient for implementing more advanced HSM features.

Some of the HSM feature that I would like are:
- blocking hook before access to file range and fill that range
- blocking hook before lookup of child and optionally create child

My thoughts on the UAPI were:
- Allow new combination of FAN_CLASS_PRE_CONTENT
  and FAN_REPORT_FID/DFID_NAME
- This combination does not allow any of the existing events
  in mask
- It Allows only new events such as FAN_PRE_ACCESS
  FAN_PRE_MODIFY and FAN_PRE_LOOKUP
- FAN_PRE_ACCESS and FAN_PRE_MODIFY can have
  optional file range info
- All the FAN_PRE_ events are called outside vfs locks and
  specifically before sb_writers lock as in my fsnotify_pre_modify [1]
  POC

That last part is important because the HSM daemon will
need to make modifications to the accessed file/directory
before allowing the operation to proceed.

Naturally that opens the possibility for new userspace
deadlocks. Nothing that is not already possible with permission
event, but maybe deadlocks that are more inviting to trip over.

I am not sure if we need to do anything about this, but we
could make it easier to ignore events from the HSM daemon
itself if we want to, to make the userspace implementation easier.

Another thing that might be good to do is provide an administrative
interface to iterate and abort pending fanotify permission/pre-content
events.

You must have noticed the overlap between my old persistent
change tracking journal and this design. The referenced branch
is from that old POC.

I do believe that the use cases somewhat overlap and that the
same building blocks could be used to implement a persistent
change journal in userspace as you suggested back then.

Thoughts?

Amir.

[1] https://github.com/amir73il/linux/commits/fsnotify_pre_modify



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux