Re: [PATCH v2 1/8] btrfs-progs: check: fix max inline extent size
From: Qu Wenruo
Date: Thu Jun 25 2026 - 19:41:52 EST
在 2026/6/25 02:21, Daniel Vacek 写道:
From: Josef Bacik <josef@xxxxxxxxxxxxxx>
Fscrypt will use our entire inline extent range for symlinks, which
uncovered a bug in btrfs check where we set the maximum inline extent
size to
min(sectorsize - 1, BTRFS_MAX_INLINE_DATA_SIZE)
which isn't correct, we have always allowed sectorsize sized inline
extents, so fix check to use the correct maximum inline extent size.
No, we only allow sector sized inline extent when it is compressed.
The de-compressed size can be sector sized, but the compressed size still can not reach sector size.
So this doesn't seems correct to me.
Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
Signed-off-by: Daniel Vacek <neelx@xxxxxxxx>
---
check/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/check/main.c b/check/main.c
index 5e29e2c5..dedb4db4 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1720,7 +1720,7 @@ static int process_file_extent(struct btrfs_root *root,
u64 disk_bytenr = 0;
u64 extent_offset = 0;
u64 mask = gfs_info->sectorsize - 1;
- u32 max_inline_size = min_t(u32, mask,
+ u32 max_inline_size = min_t(u32, gfs_info->sectorsize,
BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
u8 compression;
int extent_type;