summaryrefslogtreecommitdiff
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorBoris Burkov <boris@bur.io>2023-06-29 00:03:35 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:11 +0300
commitcf79ac47932b377d0cfe6b61f4472cdc17eac042 (patch)
treefd2d934f52da133279eeb65a2886f3a332c2f92d /fs/btrfs/backref.c
parent457cb1ddf5e8d895e9c551cad6b84bafae41f32c (diff)
downloadlinux-cf79ac47932b377d0cfe6b61f4472cdc17eac042.tar.xz
btrfs: track original extent owner in head_ref
Simple quotas requires tracking the original creating root of any given extent. This gets complicated when multiple subvolumes create overlapping/contradictory refs in the same transaction. For example, due to modifying or deleting an extent while also snapshotting it. To resolve this in a general way, take advantage of the fact that we are essentially already tracking this for handling releasing reservations. The head ref coalesces the various refs and uses must_insert_reserved to check if it needs to create an extent/free reservation. Store the ref that set must_insert_reserved as the owning ref on the head ref. Note that this can result in writing an extent for the very first time with an owner different from its only ref, but it will look the same as if you first created it with the original owning ref, then added the other ref, then removed the owning ref. Signed-off-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
0 files changed, 0 insertions, 0 deletions