Unionfs: remove unnecessary locking in follow-link
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 20:40:23 +0000 (15:40 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:37:16 +0000 (22:37 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 37258c82049ab13fe83fb610777ee27ae5144444..7ec9c1b7647025674298a7a86f11d1804b2da510 100644 (file)
@@ -851,7 +851,8 @@ out:
  * nor do we need to revalidate it either.  It is safe to not lock our
  * dentry here, nor revalidate it, because unionfs_follow_link does not do
  * anything (prior to calling ->readlink) which could become inconsistent
- * due to branch management.
+ * due to branch management.  We also don't need to lock our super because
+ * this function isn't affected by branch-management.
  */
 static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
@@ -859,8 +860,6 @@ static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
        int len = PAGE_SIZE, err;
        mm_segment_t old_fs;
 
-       unionfs_read_lock(dentry->d_sb);
-
        /* This is freed by the put_link method assuming a successful call. */
        buf = kmalloc(len, GFP_KERNEL);
        if (unlikely(!buf)) {
@@ -885,7 +884,6 @@ static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 out:
        unionfs_check_dentry(dentry);
        unionfs_check_nd(nd);
-       unionfs_read_unlock(dentry->d_sb);
        return ERR_PTR(err);
 }