btrfs: create qgroup earlier in snapshot creation
authorBoris Burkov <boris@bur.io>
Wed, 28 Jun 2023 18:00:05 +0000 (11:00 -0700)
committerDavid Sterba <dsterba@suse.com>
Thu, 12 Oct 2023 14:44:10 +0000 (16:44 +0200)
commit6ed05643ddb166c0fddabac8ee092659006214a9
treed4170bc6404d703e0eeecb955cbb76322679585f
parentaf0e2aab3b70b7844232bbce2a619ec70e049df4
btrfs: create qgroup earlier in snapshot creation

Pull creating the qgroup earlier in the snapshot. This allows simple
quotas qgroups to see all the metadata writes related to the snapshot
being created and to be born with the root node accounted.

Note this has an impact on transaction commit where the qgroup creation
can do a lot of work, allocate memory and take locks. The change is done
for correctness, potential performance issues will be fixed in the
future.

Signed-off-by: Boris Burkov <boris@bur.io>
[ add note ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c
fs/btrfs/transaction.c