Skip to content

Commit

Permalink
Btrfs: remove mnt_want_write call in btrfs_mksubvol
Browse files Browse the repository at this point in the history
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 e784868 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>
  • Loading branch information
Alexander Block authored and Chris Mason committed Aug 9, 2012
1 parent 0d7614f commit e00da20
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -703,7 +699,6 @@ static noinline int btrfs_mksubvol(struct path *parent,
dput(dentry);
out_unlock:
mutex_unlock(&dir->i_mutex);
mnt_drop_write(parent->mnt);
return error;
}

Expand Down

0 comments on commit e00da20

Please sign in to comment.