mbox series

[0/2] btrfs: subvol qgroup lifetime invariants

Message ID cover.1705711967.git.boris@bur.io (mailing list archive)
Headers show
Series btrfs: subvol qgroup lifetime invariants | expand

Message

Boris Burkov Jan. 20, 2024, 12:55 a.m. UTC
Subvol qgroups (id 0/SUBVOLID) are special. They get created
and reaped automatically for subvols, and can never have any children by
virtue of being at level 0.

Manually managing them doesn't provide much value but does create the
possibility for weird states and races. To that end, ban deleting subvol
qgroups that still have usage and creating subvol qgroups at all.

Testing Note: this patch series breaks btrfs/303 as that test is hunting
a race to do with creating a subvol qgroup which now explicitly fails.

Boris Burkov (2):
  btrfs: forbid creating subvol qgroups
  btrfs: forbid deleting live subvol qgroup

 fs/btrfs/ioctl.c  |  5 +++++
 fs/btrfs/qgroup.c | 15 +++++++++++++++
 2 files changed, 20 insertions(+)