Re: [PATCH v2 1/8] btrfs-progs: check: fix max inline extent size
Qu Wenruo <[email protected]> Fri, 26 Jun 2026 09:10:57 +0930
| Newsgroups | org.kernel.vger.linux-fscrypt,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
在 2026/6/25 02:21, Daniel Vacek 写道: > From: Josef Bacik <[email protected]> > > 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 <[email protected]> > Signed-off-by: Daniel Vacek <[email protected]> > --- > 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;