Unionfs: remove unnecessary conditional inode lock
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 20 Dec 2007 20:22:22 +0000 (15:22 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:37:15 +0000 (22:37 -0400)
This was intended to protect the inode during branch management, but that is
now done through our superblock rwsem.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index 68c07ba8a19bcd8053ad90819e4065e1c9d1c0b6..dc1aa39ea42edb8146197e1ac16dd4e888027b9c 100644 (file)
@@ -33,7 +33,6 @@ static bool __unionfs_d_revalidate_one(struct dentry *dentry,
        int bindex, bstart, bend;
        int sbgen, dgen;
        int positive = 0;
-       int locked = 0;
        int interpose_flag;
        struct nameidata lowernd; /* TODO: be gentler to the stack */
 
@@ -87,16 +86,6 @@ static bool __unionfs_d_revalidate_one(struct dentry *dentry,
                interpose_flag = INTERPOSE_REVAL_NEG;
                if (positive) {
                        interpose_flag = INTERPOSE_REVAL;
-                       /*
-                        * During BRM, the VFS could already hold a lock on
-                        * a file being read, so don't lock it again
-                        * (deadlock), but if you lock it in this function,
-                        * then release it here too.
-                        */
-                       if (!mutex_is_locked(&dentry->d_inode->i_mutex)) {
-                               mutex_lock(&dentry->d_inode->i_mutex);
-                               locked = 1;
-                       }
 
                        bstart = ibstart(dentry->d_inode);
                        bend = ibend(dentry->d_inode);
@@ -115,8 +104,6 @@ static bool __unionfs_d_revalidate_one(struct dentry *dentry,
                        UNIONFS_I(dentry->d_inode)->lower_inodes = NULL;
                        ibstart(dentry->d_inode) = -1;
                        ibend(dentry->d_inode) = -1;
-                       if (locked)
-                               mutex_unlock(&dentry->d_inode->i_mutex);
                }
 
                result = unionfs_lookup_backend(dentry, &lowernd,