Unionfs: remove unnecessary locking in follow-link
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 22:19:41 +0000 (17:19 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 22:19:41 +0000 (17:19 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 048c425c187300b6201ab6b7a3fb3f91e7b27fef..1255edbeb80aee449a4a0bc382571e2e440d287e 100644 (file)
@@ -842,7 +842,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 int unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
@@ -850,8 +851,6 @@ static int 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)) {
@@ -875,7 +874,6 @@ static int unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 
 out:
        unionfs_check_dentry(dentry);
-       unionfs_read_unlock(dentry->d_sb);
        return err;
 }