login
Header Space

 
 

[patch 06/24] hpfs: dont call notify_change

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: <hch@...>, <viro@...>, <linux-fsdevel@...>, <linux-kernel@...>, Mikulas Patocka <mikulas@...>
Date: Tuesday, May 6, 2008 - 5:13 am

From: Miklos Szeredi <mszeredi@suse.cz>

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?

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
---
 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;

--
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 06/24] hpfs: dont call notify_change, Miklos Szeredi, (Tue May 6, 5:13 am)
Re: [patch 06/24] hpfs: dont call notify_change, Christoph Hellwig, (Thu May 8, 12:52 pm)
Re: [patch 06/24] hpfs: dont call notify_change, Mikulas Patocka, (Thu May 8, 9:59 pm)
Re: [patch 06/24] hpfs: dont call notify_change, Mikulas Patocka, (Wed May 7, 8:41 pm)
speck-geostationary