]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: fix missing snapshot drew unlock when root is dead during swap activation
authorFilipe Manana <fdmanana@suse.com>
Fri, 29 Nov 2024 13:33:03 +0000 (13:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:43 +0000 (19:51 +0100)
commit968757f1f45b7341ee26e78687ec96c4abeb03a1
tree04773c60d77d26b7ff47799298873404f412c466
parent38a4826f1bdf739081dbf1de9f008a0e1c668309
btrfs: fix missing snapshot drew unlock when root is dead during swap activation

[ Upstream commit 9c803c474c6c002d8ade68ebe99026cc39c37f85 ]

When activating a swap file we acquire the root's snapshot drew lock and
then check if the root is dead, failing and returning with -EPERM if it's
dead but without unlocking the root's snapshot lock. Fix this by adding
the missing unlock.

Fixes: 60021bd754c6 ("btrfs: prevent subvol with swapfile from being deleted")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/inode.c