Unionfs: follow_link locking fixes
authorRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Fri, 29 Feb 2008 17:01:57 +0000 (12:01 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Fri, 29 Feb 2008 17:01:57 +0000 (12:01 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 06eb84270f4ff628ce9faf432cc2e144262349bc..c456f300107376f0c43e88cca357b11090a55e88 100644 (file)
@@ -717,7 +717,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);
 }