]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: drop log root for dropped roots
authorJosef Bacik <josef@toxicpanda.com>
Fri, 17 Jan 2020 14:12:45 +0000 (09:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:35:33 +0000 (04:35 -0800)
commitce066845584ae8e18d1d07920f7922fc4dc2610a
treeceb5012ba5fd4af21d9e1f9d5d39327f0582b25b
parent7baf8f665b7750449d2a7fff62dfbd206007c62d
btrfs: drop log root for dropped roots

commit 889bfa39086e86b52fcfaa04d72c95eaeb12f9a5 upstream.

If we fsync on a subvolume and create a log root for that volume, and
then later delete that subvolume we'll never clean up its log root.  Fix
this by making switch_commit_roots free the log for any dropped roots we
encounter.  The extra churn is because we need a btrfs_trans_handle, not
the btrfs_transaction.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/transaction.c