linux/fs/btrfs
Boris Burkov cf79ac4793 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>
2023-10-12 16:44:11 +02:00
..
tests btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
accessors.c
accessors.h btrfs: add raid stripe tree definitions 2023-10-12 16:44:09 +02:00
acl.c
acl.h
async-thread.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
async-thread.h btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
backref.c btrfs: remove v0 extent handling 2023-08-21 14:54:48 +02:00
backref.h btrfs: rename errno identifiers to error 2023-10-12 16:44:07 +02:00
bio.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
bio.h btrfs: add an ordered_extent pointer to struct btrfs_bio 2023-06-19 13:59:36 +02:00
block-group.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
block-group.h btrfs: rename add_new_free_space() to btrfs_add_new_free_space() 2023-08-21 14:52:12 +02:00
block-rsv.c btrfs: read raid stripe tree from disk 2023-10-12 16:44:09 +02:00
block-rsv.h
btrfs_inode.h btrfs: reduce size and reorder compression members in struct btrfs_inode 2023-10-12 16:44:04 +02:00
compression.c btrfs: rename errno identifiers to error 2023-10-12 16:44:07 +02:00
compression.h btrfs: pass an ordered_extent to btrfs_submit_compressed_write 2023-06-19 13:59:36 +02:00
ctree.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
ctree.h btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
defrag.c
defrag.h
delalloc-space.c btrfs: don't arbitrarily slow down delalloc if we're committing 2023-10-12 16:44:08 +02:00
delalloc-space.h
delayed-inode.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
delayed-inode.h btrfs: add __counted_by for struct btrfs_delayed_item and use struct_size() 2023-10-11 11:37:19 +02:00
delayed-ref.c btrfs: track original extent owner in head_ref 2023-10-12 16:44:11 +02:00
delayed-ref.h btrfs: track original extent owner in head_ref 2023-10-12 16:44:11 +02:00
dev-replace.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
dev-replace.h
dir-item.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
dir-item.h btrfs: add fscrypt related dependencies to respective headers 2023-10-12 16:44:02 +02:00
discard.c
discard.h
disk-io.c btrfs: read raid stripe tree from disk 2023-10-12 16:44:09 +02:00
disk-io.h btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
export.c
export.h
extent-io-tree.c btrfs: make find_first_extent_bit() return a boolean 2023-08-21 14:52:12 +02:00
extent-io-tree.h btrfs: make find_first_extent_bit() return a boolean 2023-08-21 14:52:12 +02:00
extent-tree.c btrfs: track owning root in btrfs_ref 2023-10-12 16:44:11 +02:00
extent-tree.h btrfs: allow to run delayed refs by bytes to be released instead of count 2023-10-12 16:44:06 +02:00
extent_io.c btrfs: warn on tree blocks which are not nodesize aligned 2023-10-12 16:44:09 +02:00
extent_io.h btrfs: move extent_buffer::lock_owner to debug section 2023-10-12 16:44:05 +02:00
extent_map.c btrfs: fix incorrect splitting in btrfs_drop_extent_map_range 2023-08-18 14:38:10 +02:00
extent_map.h btrfs: pass the new logical address to split_extent_map 2023-06-19 13:59:33 +02:00
file-item.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
file-item.h btrfs: scrub: avoid unnecessary csum tree search preparing stripes 2023-08-21 14:54:48 +02:00
file.c btrfs: track owning root in btrfs_ref 2023-10-12 16:44:11 +02:00
file.h
free-space-cache.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
free-space-cache.h
free-space-tree.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
free-space-tree.h
fs.c
fs.h btrfs: qgroup: add new quota mode for simple quotas 2023-10-12 16:44:10 +02:00
inode-item.c btrfs: track owning root in btrfs_ref 2023-10-12 16:44:11 +02:00
inode-item.h btrfs: add fscrypt related dependencies to respective headers 2023-10-12 16:44:02 +02:00
inode.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
ioctl.c btrfs: qgroup: add new quota mode for simple quotas 2023-10-12 16:44:10 +02:00
ioctl.h
Kconfig btrfs: check-integrity: remove CONFIG_BTRFS_FS_CHECK_INTEGRITY option 2023-10-12 16:44:05 +02:00
locking.c btrfs: add raid stripe tree definitions 2023-10-12 16:44:09 +02:00
locking.h btrfs: do not block starts waiting on previous transaction commit 2023-09-08 14:10:49 +02:00
lru_cache.c
lru_cache.h
lzo.c btrfs: disable allocation warnings for compression workspaces 2023-06-19 13:59:34 +02:00
Makefile btrfs: add support for inserting raid stripe extents 2023-10-12 16:44:09 +02:00
messages.c btrfs: rename errno identifiers to error 2023-10-12 16:44:07 +02:00
messages.h btrfs: rename errno identifiers to error 2023-10-12 16:44:07 +02:00
misc.h minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
ordered-data.c btrfs: merge ordered work callbacks in btrfs_work into one 2023-10-12 16:44:10 +02:00
ordered-data.h btrfs: add support for inserting raid stripe extents 2023-10-12 16:44:09 +02:00
orphan.c
orphan.h
print-tree.c btrfs: add raid stripe tree pretty printer 2023-10-12 16:44:09 +02:00
print-tree.h
props.c btrfs: move btrfs_name_hash to dir-item.h 2023-10-12 16:44:02 +02:00
props.h
qgroup.c btrfs: add helper for recording simple quota deltas 2023-10-12 16:44:11 +02:00
qgroup.h btrfs: add helper for recording simple quota deltas 2023-10-12 16:44:11 +02:00
raid-stripe-tree.c btrfs: tracepoints: add events for raid stripe tree 2023-10-12 16:44:10 +02:00
raid-stripe-tree.h btrfs: zoned: support RAID0/1/10 on top of raid stripe tree 2023-10-12 16:44:09 +02:00
raid56.c btrfs: scrub: avoid unnecessary csum tree search preparing stripes 2023-08-21 14:54:48 +02:00
raid56.h btrfs: raid56: remove unused BTRFS_RBIO_REBUILD_MISSING 2023-08-21 14:52:12 +02:00
rcu-string.h
ref-verify.c btrfs: rename tree_ref and data_ref owning_root 2023-10-12 16:44:11 +02:00
ref-verify.h
reflink.c btrfs: convert to ctime accessor functions 2023-07-13 10:28:04 +02:00
reflink.h
relocation.c btrfs: track owning root in btrfs_ref 2023-10-12 16:44:11 +02:00
relocation.h btrfs: pass an ordered_extent to btrfs_reloc_clone_csums 2023-06-19 13:59:36 +02:00
root-tree.c btrfs: qgroup: add new quota mode for simple quotas 2023-10-12 16:44:10 +02:00
root-tree.h btrfs: drop __must_check annotations 2023-10-12 16:44:04 +02:00
scrub.c btrfs: scrub: implement raid stripe tree support 2023-10-12 16:44:09 +02:00
scrub.h
send.c btrfs: remove btrfs_crc32c wrapper 2023-10-12 16:44:02 +02:00
send.h
space-info.c btrfs: allow to run delayed refs by bytes to be released instead of count 2023-10-12 16:44:06 +02:00
space-info.h btrfs: pass a space_info argument to btrfs_reserve_metadata_bytes() 2023-10-12 16:44:05 +02:00
subpage.c btrfs: stop setting PageError in the data I/O path 2023-06-19 13:59:35 +02:00
subpage.h btrfs: stop setting PageError in the data I/O path 2023-06-19 13:59:35 +02:00
super.c btrfs: scan but don't register device on single device filesystem 2023-10-12 16:44:07 +02:00
super.h
sysfs.c btrfs: sysfs: add simple_quota incompat feature entry 2023-10-12 16:44:10 +02:00
sysfs.h
transaction.c btrfs: create qgroup earlier in snapshot creation 2023-10-12 16:44:10 +02:00
transaction.h btrfs: rename errno identifiers to error 2023-10-12 16:44:07 +02:00
tree-checker.c btrfs: tree-checker: add support for raid stripe tree 2023-10-12 16:44:10 +02:00
tree-checker.h
tree-log.c btrfs: track owning root in btrfs_ref 2023-10-12 16:44:11 +02:00
tree-log.h
tree-mod-log.c btrfs: avoid tree mod log ENOMEM failures when we don't need to log 2023-06-19 13:59:38 +02:00
tree-mod-log.h
ulist.c btrfs: reformat remaining kdoc style comments 2023-10-12 16:44:04 +02:00
ulist.h
uuid-tree.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
uuid-tree.h
verity.c btrfs: convert btrfs_read_merkle_tree_page() to use a folio 2023-09-13 18:40:54 +02:00
verity.h
volumes.c btrfs: zoned: support RAID0/1/10 on top of raid stripe tree 2023-10-12 16:44:09 +02:00
volumes.h btrfs: scrub: implement raid stripe tree support 2023-10-12 16:44:09 +02:00
xattr.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
xattr.h
zlib.c btrfs: disable allocation warnings for compression workspaces 2023-06-19 13:59:34 +02:00
zoned.c btrfs: zoned: support RAID0/1/10 on top of raid stripe tree 2023-10-12 16:44:09 +02:00
zoned.h btrfs: zoned: reserve zones for an active metadata/system block group 2023-08-21 14:52:19 +02:00
zstd.c btrfs: reformat remaining kdoc style comments 2023-10-12 16:44:04 +02:00