All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: fix inlined file extent items in data reloc
@ 2026-06-22 22:55 Qu Wenruo
  2026-06-22 22:55 ` [PATCH v2 1/2] btrfs: do not try compression for data reloc inodes Qu Wenruo
  2026-06-22 22:55 ` [PATCH v2 2/2] btrfs: reject inline file extent item in get_new_location() Qu Wenruo
  0 siblings, 2 replies; 9+ messages in thread
From: Qu Wenruo @ 2026-06-22 22:55 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v2:
- Add more explanation on why we can created inlined extents even if
  relocation is preallocating space

- Add the fixes: tag since the behavior is caused by a specific commit

There is a syzbot report that an inlined file extent item in a data
reloc inode triggered a sanity check in get_new_location().

It turns out that we can create inlined file extents for data reloc
inodes in the first place after commit 3eaf5f082c4c ("btrfs: extract
inlined creation into a dedicated delalloc helper").

So the first patch will avoid compression for data reloc inodes first,
then the second patch to reject inlined file extent items in
get_new_location(), making the checks more robust.

Qu Wenruo (2):
  btrfs: do not try compression for data reloc inodes
  btrfs: reject inline file extent item in get_new_location()

 fs/btrfs/btrfs_inode.h | 2 ++
 fs/btrfs/relocation.c  | 7 +++++++
 2 files changed, 9 insertions(+)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] btrfs: print-tree: print header owner as signed
@ 2026-06-22 22:55 ` Qu Wenruo
  0 siblings, 0 replies; 9+ messages in thread
From: Qu Wenruo @ 2026-06-21  9:11 UTC (permalink / raw)
  To: linux-btrfs

When dumpping a tree block, btrfs_header::owner is printed as
unsigned, which can result in numbers that are hard to read, e.g:

 BTRFS info (device loop0): leaf 8908800 gen 16 total ptrs 28 free space 1676 owner 18446744073709551607

For the above output, 18446744073709551607 is (s64)-9, the root id of data
reloc tree.

Despite those pre-defined root ids that are already negative, existing
subvolume trees will not have any negative values, as subvolume trees can
only utilize the lower 48 bits, so there will be no output change for
existing subvolumes, thus no extra confusion.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/print-tree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 87e60a2d4bd8..53e726119ca7 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -449,9 +449,9 @@ void btrfs_print_leaf(const struct extent_buffer *l)
 	nr = btrfs_header_nritems(l);
 
 	btrfs_info(fs_info,
-		   "leaf %llu gen %llu total ptrs %d free space %d owner %llu",
+		   "leaf %llu gen %llu total ptrs %d free space %d owner %lld",
 		   btrfs_header_bytenr(l), btrfs_header_generation(l), nr,
-		   btrfs_leaf_free_space(l), btrfs_header_owner(l));
+		   btrfs_leaf_free_space(l), (s64)btrfs_header_owner(l));
 	print_eb_refs_lock(l);
 	for (i = 0 ; i < nr ; i++) {
 		char key_buf[KEY_TYPE_BUF_SIZE];
@@ -600,10 +600,10 @@ void btrfs_print_tree(const struct extent_buffer *c, bool follow)
 		return;
 	}
 	btrfs_info(fs_info,
-		   "node %llu level %d gen %llu total ptrs %d free spc %u owner %llu",
+		   "node %llu level %d gen %llu total ptrs %d free spc %u owner %lld",
 		   btrfs_header_bytenr(c), level, btrfs_header_generation(c),
 		   nr, (u32)BTRFS_NODEPTRS_PER_BLOCK(fs_info) - nr,
-		   btrfs_header_owner(c));
+		   (s64)btrfs_header_owner(c));
 	print_eb_refs_lock(c);
 	for (i = 0; i < nr; i++) {
 		btrfs_node_key_to_cpu(c, &key, i);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-06-23  3:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 22:55 [PATCH v2 0/2] btrfs: fix inlined file extent items in data reloc Qu Wenruo
2026-06-22 22:55 ` [PATCH v2 1/2] btrfs: do not try compression for data reloc inodes Qu Wenruo
2026-06-22 22:55 ` [PATCH v2 2/2] btrfs: reject inline file extent item in get_new_location() Qu Wenruo
  -- strict thread matches above, loose matches on Subject: below --
2026-06-21  9:11 [PATCH] btrfs: print-tree: print header owner as signed Qu Wenruo
2026-06-22 22:55 ` Qu Wenruo
2026-06-22 11:17 ` Filipe Manana
2026-06-22 12:00 ` sun k
2026-06-23  0:07   ` David Sterba
2026-06-23  3:21     ` sun k

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.