Commit e00da206 authored by Alexander Block's avatar Alexander Block Committed by Chris Mason

Btrfs: remove mnt_want_write call in btrfs_mksubvol

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 a874a63e
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: default avatarDavid Sterba <dave@jikos.cz>
Signed-off-by: default avatarAlexander Block <ablock84@googlemail.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 0d7614f0
...@@ -664,10 +664,6 @@ static noinline int btrfs_mksubvol(struct path *parent, ...@@ -664,10 +664,6 @@ static noinline int btrfs_mksubvol(struct path *parent,
struct dentry *dentry; struct dentry *dentry;
int error; int error;
error = mnt_want_write(parent->mnt);
if (error)
return error;
mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
dentry = lookup_one_len(name, parent->dentry, namelen); dentry = lookup_one_len(name, parent->dentry, namelen);
...@@ -703,7 +699,6 @@ static noinline int btrfs_mksubvol(struct path *parent, ...@@ -703,7 +699,6 @@ static noinline int btrfs_mksubvol(struct path *parent,
dput(dentry); dput(dentry);
out_unlock: out_unlock:
mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex);
mnt_drop_write(parent->mnt);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment