]> git.baikalelectronics.ru Git - kernel.git/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>
Fri, 13 Dec 2019 13:09:23 +0000 (14:09 +0100)
commit8dc436efcad2deb0e26624ffd28b11226535fa6a
treea649d2de74efae956436897461ba66cbf0ed3557
parent1b8bb8b2e474e90b95ba9f28b9a545ace290d3c1
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: ef5f03fe1064 ("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