Unionfs: follow_link locking fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 02:52:47 +0000 (21:52 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 02:52:47 +0000 (21:52 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 5b025f07ea350d017fa764ec0ac16c88db49ace1..ae4d66d87cb2cbfe090633aa32fcc33708e90254 100644 (file)
@@ -812,7 +812,11 @@ static int 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);
+       }
        return err;
 }