]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: destroy qgroup extent records on transaction abort
authorJeff Mahoney <jeffm@suse.com>
Tue, 11 Feb 2020 07:25:37 +0000 (15:25 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Feb 2020 23:35:54 +0000 (00:35 +0100)
commitda7c7ea1318d251d282b22f8a3b6fd9a5a7df894
tree6c2ddb770d4bcdbd85db0881d040db3bbd21eb7b
parentabd1ae28ff3634733c3f7d047d9cf0bee5602b74
btrfs: destroy qgroup extent records on transaction abort

We clean up the delayed references when we abort a transaction but we
leave the pending qgroup extent records behind, leaking memory.

This patch destroys the extent records when we destroy the delayed refs
and makes sure ensure they're gone before releasing the transaction.

Fixes: 46fdfa753e0f ("btrfs: qgroup: Record possible quota-related extent for qgroup.")
CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
[ Rebased to latest upstream, remove to_qgroup() helper, use
  rbtree_postorder_for_each_entry_safe() wrapper ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h
fs/btrfs/transaction.c