]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Btrfs: remove mnt_want_write call in btrfs_mksubvol
authorAlexander Block <ablock84@googlemail.com>
Thu, 2 Aug 2012 23:16:20 +0000 (17:16 -0600)
committerChris Mason <chris.mason@fusionio.com>
Thu, 9 Aug 2012 15:01:54 +0000 (11:01 -0400)
We got a recursive lock in mksubvol because the caller already held
a lock. I think we got into this due to a merge error. Commit a874a63
removed the mnt_want_write call from btrfs_mksubvol and added a
replacement call to mnt_want_write_file in btrfs_ioctl_snap_create_transid.
Commit e7848683 however tried to move all calls to mnt_want_write above
i_mutex. So somewhere while merging this, it got mixed up. The
solution is to remove the mnt_want_write call completely from
mksubvol.

Reported-by: David Sterba <dave@jikos.cz>
Signed-off-by: Alexander Block <ablock84@googlemail.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c

index bc2f6ffff3cfb004099a5d4eb84f8a9aa688d7cd..7bb755677a220f71fd0540932c0c19565aec6a23 100644 (file)
@@ -664,10 +664,6 @@ static noinline int btrfs_mksubvol(struct path *parent,
        struct dentry *dentry;
        int error;
 
-       error = mnt_want_write(parent->mnt);
-       if (error)
-               return error;
-
        mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
 
        dentry = lookup_one_len(name, parent->dentry, namelen);
@@ -703,7 +699,6 @@ out_dput:
        dput(dentry);
 out_unlock:
        mutex_unlock(&dir->i_mutex);
-       mnt_drop_write(parent->mnt);
        return error;
 }