f2fs: expose resizable_tail feature via sysfs

Userspace has no way to know whether the kernel supports the
resizable_tail_secno mount option before mounting. Passing it to a
kernel without the support fails the mount with -EINVAL, and checking
/sys/fs/f2fs/<disk>/pinned_area_max_secno requires an f2fs instance
to be mounted already.

Export /sys/fs/f2fs/features/resizable_tail so that userspace can check
the support before formatting or mounting a filesystem that relies on
resizable_tail_secno, e.g. a filesystem whose tail is going to be shrunk
online later.

Cc: stable@vger.kernel.org
Fixes: c966d29e01 ("f2fs: support resizable tail section and unify pinned allocation")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Daeho Jeong 2026-10-14 15:21:38 +00:00 committed by Jaegeuk Kim
parent fd0da04b25
commit 714f97f477
2 changed files with 3 additions and 1 deletions

View File

@ -271,7 +271,7 @@ Description: Shows all enabled kernel features.
inode_crtime, lost_found, verity, sb_checksum,
casefold, readonly, compression, test_dummy_encryption_v2,
atomic_write, pin_file, encrypted_casefold, linear_lookup,
fserror, metadata_cache.
fserror, metadata_cache, resizable_tail.
What: /sys/fs/f2fs/<disk>/inject_rate
Date: May 2016

View File

@ -1427,6 +1427,7 @@ F2FS_FEATURE_RO_ATTR(linear_lookup);
F2FS_FEATURE_RO_ATTR(packed_ssa);
F2FS_FEATURE_RO_ATTR(fserror);
F2FS_FEATURE_RO_ATTR(metadata_cache);
F2FS_FEATURE_RO_ATTR(resizable_tail);
#define ATTR_LIST(name) (&f2fs_attr_##name.attr)
static struct attribute *f2fs_attrs[] = {
@ -1602,6 +1603,7 @@ static struct attribute *f2fs_feat_attrs[] = {
BASE_ATTR_LIST(packed_ssa),
BASE_ATTR_LIST(fserror),
BASE_ATTR_LIST(metadata_cache),
BASE_ATTR_LIST(resizable_tail),
NULL,
};
ATTRIBUTE_GROUPS(f2fs_feat);