mbox series

[0/7] btrfs: various qg meta rsv leak fixes

Message ID cover.1711488980.git.boris@bur.io (mailing list archive)
Headers show
Series btrfs: various qg meta rsv leak fixes | expand

Message

Boris Burkov March 26, 2024, 9:39 p.m. UTC
generic/269 and generic/475 expose a number of reservation accounting
issues in the btrfs quotas code that is shared between qgroups and
squotas. In particular, error paths for failed transactions and errors
in start_transaction and other critical functions for root per-trans
accounting.

These semi-related patches fix up a number of such issues. With them,
generic/269 with -O squota passed 1000+ times in a row for me and
generic/475 has run hundreds of iterations without ever failing on a
metadata reservation leak warning. generic/475 does still see issues
with qgroup data reservation accounting and only passes ~9/10 times
on my system.

Boris Burkov (7):
  btrfs: correctly model root qgroup rsv in convert
  btrfs: fix qgroup prealloc rsv leak in subvolume operations
  btrfs: record delayed inode root in transaction
  btrfs: convert PREALLOC to PERTRANS after record_root_in_trans
  btrfs: free pertrans at end of cleanup_transaction
  btrfs: btrfs_clear_delalloc_extent frees rsv
  btrfs: always clear meta pertrans during commit

 fs/btrfs/delayed-inode.c |  3 +++
 fs/btrfs/disk-io.c       |  3 +--
 fs/btrfs/inode.c         | 15 +++++++++++++--
 fs/btrfs/ioctl.c         | 37 ++++++++++++++++++++++++++++---------
 fs/btrfs/qgroup.c        |  2 ++
 fs/btrfs/root-tree.c     | 10 ----------
 fs/btrfs/root-tree.h     |  2 --
 fs/btrfs/transaction.c   | 19 +++++++++----------
 8 files changed, 56 insertions(+), 35 deletions(-)