Unionfs: remove unnecessary locking in follow-link
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 10 Jan 2008 12:01:01 +0000 (07:01 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:30 +0000 (19:03 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index 7a1de457a7be22e4ca4dd9df138447ba6537e77c..fb6b65a69f0bd0898b533d91e8cbe037f6474d8a 100644 (file)
@@ -681,7 +681,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)
 {
@@ -689,8 +690,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)) {
@@ -715,7 +714,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);
 }