Return-Path: Received: from mx2.suse.de ([195.135.220.15]:43834 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725843AbeKTXOc (ORCPT ); Tue, 20 Nov 2018 18:14:32 -0500 Date: Tue, 20 Nov 2018 13:45:33 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 4/5] fsnotify: make MOVED_FROM a dentry event Message-ID: <20181120124533.GI8842@quack2.suse.cz> References: <20181114174344.17530-1-amir73il@gmail.com> <20181114174344.17530-5-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114174344.17530-5-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 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 SUSE Labs, CR