Re: [PATCH v2 4/5] fsnotify: make MOVED_FROM a dentry event

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

 



On Wed 14-11-18 19:43:43, Amir Goldstein wrote:
> Propagate old/new parent dentries to fsnotify_move() and pass old parent
> dentry as FSNOTIFY_EVENT_DENTRY info of MOVED_FROM event.
> 
> This change has no effect on current backends. Soon, this will allow
> fanotify backend to get MOVED_FROM events.
> 
> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>

Possibly this patch should go first in the series so that further
fsnotify_move() changes can happen to the whole function...

> diff --git a/fs/namei.c b/fs/namei.c
> index 1d743adf90a0..ecaabc081cac 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -4394,6 +4394,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
>  {
>  	int error;
>  	bool is_dir = d_is_dir(old_dentry);
> +	struct dentry *old_parent = old_dentry->d_parent;
> +	struct dentry *new_parent = new_dentry->d_parent;

Again, did you make sure old_dir == old_dentry->d_parent in all cases? If
yes, comment in the changelog would be good. Maybe CC Al Viro on this one
as rename is especially complex.  Chances he'll comment are low but if
there's something seriously broken with this, he will.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[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