f2fs: expose resizable_tail feature via sysfs
Subsystems (2)
PATCH 1/1 f2fs: expose resizable_tail feature via sysfs
From: Daeho Jeong <[email protected]>
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.
--- Documentation/ABI/testing/sysfs-fs-f2fs | 2 +- fs/f2fs/sysfs.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-fs-f2fs +1 -1
@@ -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. + fserror, resizable_tail. What: /sys/fs/f2fs/<disk>/inject_rate Date: May 2016
fs/f2fs/sysfs.c +2 -0
@@ -1421,6 +1421,7 @@ F2FS_FEATURE_RO_ATTR(linear_lookup);#endif F2FS_FEATURE_RO_ATTR (packed_ssa);F2FS_FEATURE_RO_ATTR (fserror); +F2FS_FEATURE_RO_ATTR (resizable_tail);#define ATTR_LIST (name) (&f2fs_attr_##name.attr)static struct attribute *f2fs_attrs[] = {
@@ -1592,6 +1593,7 @@ static struct attribute *f2fs_feat_attrs[] = {#endif BASE_ATTR_LIST (packed_ssa),BASE_ATTR_LIST (fserror), +BASE_ATTR_LIST (resizable_tail),NULL , };ATTRIBUTE_GROUPS (f2fs_feat);
Signature · 1 line
2.56.0.385.gd3acb90ef8-goog
+ cc: [email protected]
Quoted 58 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
Userspace has no way to know whether the kernel supports the
resizable_tail_secnomount 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_tailso that userspace can check the support before formatting or mounting a filesystem that relies onresizable_tail_secno, e.g. a filesystem whose tail is going to be shrunk online later.Fixes c966d29e01bb ("f2fs: support resizable tail section and unify pinned allocation")Signed-off-by Daeho Jeong <[email protected]>--- Documentation/ABI/testing/sysfs-fs-f2fs | 2 +- fs/f2fs/sysfs.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)Documentation/ABI/testing/sysfs-fs-f2fs +1
-1@@ -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. + fserror, resizable_tail. What: /sys/fs/f2fs/<disk>/inject_rate Date: May 2016fs/f2fs/sysfs.c +2
-1@@ -1421,6 +1421,7 @@ F2FS_FEATURE_RO_ATTR(linear_lookup);#endif F2FS_FEATURE_RO_ATTR (packed_ssa);F2FS_FEATURE_RO_ATTR (fserror); +F2FS_FEATURE_RO_ATTR (resizable_tail);#define ATTR_LIST (name) (&f2fs_attr_##name.attr)static struct attribute *f2fs_attrs[] = {@@ -1592,6 +1593,7 @@ static struct attribute *f2fs_feat_attrs[] = {#endif BASE_ATTR_LIST (packed_ssa),BASE_ATTR_LIST (fserror), +BASE_ATTR_LIST (resizable_tail),NULL , };ATTRIBUTE_GROUPS (f2fs_feat); --2.56.0.385.gd3acb90ef8-goog
Quoted 8 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
Userspace has no way to know whether the kernel supports the
resizable_tail_secnomount 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.
Quoted 8 lines
Export
/sys/fs/f2fs/features/resizable_tailso that userspace can check the support before formatting or mounting a filesystem that relies onresizable_tail_secno, e.g. a filesystem whose tail is going to be shrunk online later.Fixes c966d29e01bb ("f2fs: support resizable tail section and unify pinned allocation")Signed-off-by Daeho Jeong <[email protected]>
Thanks,