From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikulas Patocka Subject: Re: [patch 06/24] hpfs: dont call notify_change Date: Thu, 8 May 2008 02:41:24 +0200 (CEST) Message-ID: References: <20080506091327.259950960@szeredi.hu> <20080506091413.165665963@szeredi.hu> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: akpm@linux-foundation.org, hch@infradead.org, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Miklos Szeredi Return-path: In-Reply-To: <20080506091413.165665963@szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org > From: Miklos Szeredi > > hpfs_unlink() calls notify_change() to truncate the file before > deleting. Replace with explicit call to hpfs_notify_change(). > > This is equivalent, except that: > - security_inode_setattr() is not called before hpfs_notify_change() > - fsnotify_change() is not called after hpfs_notify_change() > > The truncation is just an implementation detail, so both the security > check and the notification are unnecessary. > > Possibly even the ctime modification is wrong? OK, commit the patch. Signed-off-by: Mikulas Patocka Mikulas > Signed-off-by: Miklos Szeredi > CC: Mikulas Patocka > --- > fs/hpfs/namei.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-2.6/fs/hpfs/namei.c > =================================================================== > --- linux-2.6.orig/fs/hpfs/namei.c 2008-05-06 11:04:29.000000000 +0200 > +++ linux-2.6/fs/hpfs/namei.c 2008-05-06 11:04:34.000000000 +0200 > @@ -426,7 +426,8 @@ again: > /*printk("HPFS: truncating file before delete.\n");*/ > newattrs.ia_size = 0; > newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; > - err = notify_change(dentry, &newattrs); > + newattrs.ia_ctime = current_fs_time(inode->i_sb); > + err = hpfs_notify_change(dentry, &newattrs); > put_write_access(inode); > if (!err) > goto again; > > -- >