Re: fanotify and files being moved or deleted

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

 



> > > If /home is a bind mount from, say, /data/home/ and you are watching
> > > both /home and /data, you will need to figure out that they are the same
> > > underlying fs and use a mount_fd of /data.
> >
> > My current plan is to discard any mounts which specify a root that is
> > a subpath of another mount, and in the case of multiple mounts of the
> > same root, pick one to move forward with (with hints from
> > configuration) and only mark that one.
> >
>
> You can also use open_by_handle() to determine if one mount
> is a subtree of another.
>
> if you have two fds and two different fhandles from the root of two mounts
> of the same fsid, only one of these commands will result in an fd with
> non empty path:
> fd2inmount1 = open_by_handle_at(mount1_fd, fhandle2, O_PATH);
> fd1inmount2 = open_by_handle_at(mount2_fd, fhandle1, O_PATH);
>
> So you can throw away subtree mounts of the same fsid keeping
> only one mount_fd per fsid as you traverse the mounts.
>

Well ,that's incorrect.
You may have bind mount of non-overlapping subtrees
and you may not have the root mount at all in your mount namespace.

In that case, you can always keep all mount_fd's of a certain fsid and try to
resolve the file handles in each one. Not optimal, but this is the information
we have in events at the moment.

Thanks,
Amir.




[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