aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJohn McCutchan <ttb@tentacle.dhs.org>2005-08-04 21:12:54 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-05 00:37:39 -0400
commit0c3dba1534569734ba353afdf3f11def497ff2ac (patch)
treeec52740643c710072aab5122e96851c63ed049a0 /fs
parentf10eff26831159f52353e8f15c37cdb2935d5fbf (diff)
[PATCH] Clean up inotify delete race fix
This avoids the whole #ifdef mess by just getting a copy of dentry->d_inode before d_delete is called - that makes the codepaths the same for the INOTIFY/DNOTIFY cases as for the regular no-notify case. I've been running this under a Gnome session for the last 10 minutes. Inotify is being used extensively. Signed-off-by: John McCutchan <ttb@tentacle.dhs.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 83559dce4286..32accb6a672f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1874,14 +1874,9 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
1874 1874
1875 /* We don't d_delete() NFS sillyrenamed files--they still exist. */ 1875 /* We don't d_delete() NFS sillyrenamed files--they still exist. */
1876 if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { 1876 if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
1877#if defined(CONFIG_INOTIFY) || defined(CONFIG_DNOTIFY) 1877 struct inode *inode = dentry->d_inode;
1878 dget(dentry);
1879 d_delete(dentry); 1878 d_delete(dentry);
1880 fsnotify_unlink(dentry, dir); 1879 fsnotify_unlink(dentry, inode, dir);
1881 dput(dentry);
1882#else
1883 d_delete(dentry);
1884#endif
1885 } 1880 }
1886 1881
1887 return error; 1882 return error;