Unionfs: follow_link locking fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 02:17:48 +0000 (21:17 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:44:51 +0000 (23:44 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index be05976d370cdd61570ca91f4df8071872621333..5d0cb1a0ca2f98be25c37a35424afccfe8be3e16 100644 (file)
@@ -820,7 +820,11 @@ static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
        err = 0;
 
 out:
-       unionfs_check_dentry(dentry);
+       if (!err) {
+               unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
+               unionfs_check_dentry(dentry);
+               unionfs_unlock_dentry(dentry);
+       }
        unionfs_check_nd(nd);
        return ERR_PTR(err);
 }