Unionfs: follow_link locking fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 01:33:54 +0000 (20:33 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sat, 19 Jul 2008 03:22:53 +0000 (23:22 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 8d939dc1f458481436a7fd503ba7772aa033f1fd..63775333ec1f43825ddd4c61d7fb0cc9f1e86b3c 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);
 }