]> git.hungrycats.org Git - linux/commit
btrfs: don't double lock the subvol_sem for rename exchange
authorJosef Bacik <josef@toxicpanda.com>
Tue, 19 Nov 2019 18:59:20 +0000 (13:59 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Nov 2019 15:06:53 +0000 (16:06 +0100)
commite88411ecf657a1ad2308636f10274309f9668702
tree5ccbf4e161d34154adb2fa8329f7ddba55d3cc98
parentb5c1600feefde9e601564b8be2194c2d332fd656
btrfs: don't double lock the subvol_sem for rename exchange

If we're rename exchanging two subvols we'll try to lock this lock
twice, which is bad.  Just lock once if either of the ino's are subvols.

Fixes: cdd1fedf8261 ("btrfs: add support for RENAME_EXCHANGE and RENAME_WHITEOUT")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c