Re: fsnotify path hooks

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

 



> > Hmm, notify_change() is an inconsistent name anyway (for historical
> > reasons). Consistent name would be vfs_setattr(). And
> > vfs_setattr_nonotify() would be a fine name as well. What do you think?
> >
>
> I won't propose to convert all notify_change() callers before getting an
> explicit ACK from Al, but I could still use notify_change() as a wrapper
> around vfs_setattr_nonotify() and maybe also create an alias vfs_setattr()
> and use it in some places.
>

Tried that. It didn't go so well.
Renamed s/notify_change/vfs_setattr and then created a wrapper
vfs_setattr_notify(mnt, ...

First issue is that there are no callers left to vfs_setattr(), so the two
phase conversion becomes: s/notify_change/vfs_setattr_change
which is mostly noise.

The second issue is that fsnotify_change() takes @ia_valid arg, which
may be modified inside notify_change().

Which brings me back to the last resort.

Al,

Would you be willing to make an exception for notify_change()
and pass mnt arg to the helper? and if so, which of the following
is the lesser evil in your opinion:

1. Optional mnt arg
--------------------------
int notify_change(struct vfsmount *mnt,
                 struct user_namespace *mnt_userns,
                 struct dentry *dentry, struct iattr *attr,
                 struct inode **delegated_inode)

@mnt is non-NULL from syscalls and nfsd and NULL from other callers.

2. path instead of dentry
--------------------------------
int notify_change(struct user_namespace *mnt_userns,
                 struct path *path, struct iattr *attr,
                 struct inode **delegated_inode)

This is symmetric with vfs_getattr().
syscalls and nfsd use the actual path.
overlayfs, ecryptfs, cachefiles compose a path from the private mount
(Christian posted patches to make ecryptfs, cachefiles mount private).

3. Mandatory mnt arg
-----------------------------
Like #1, but use some private mount instead of NULL, similar to the
mnt_userns arg.

Any of the above acceptable?

Pushed option #1 (along with rest of the work) to:
https://github.com/amir73il/linux/commits/fsnotify_path_hooks

It's only sanity tested.

Thanks,
Amir.



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

  Powered by Linux