* [f2fs-dev] [PATCH] f2fs: expose subpage_block feature via sysfs
@ 2026-12-02 21:45 ` Daeho Jeong
0 siblings, 0 replies; 2+ messages in thread
From: Daeho Jeong @ 2026-12-02 21:45 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
From: Daeho Jeong <daehojeong@google.com>
f2fs can mount a filesystem whose block size is smaller than the page
size, down to 4KB. A kernel without this support rejects such a
filesystem at mount time, and userspace has no way to tell the two
apart. A tool that formats a device needs to know it before picking the
block size, e.g. to choose between 4KB and 16KB blocks on a 16KB page
kernel.
Add /sys/fs/f2fs/features/subpage_block, so that userspace can check
whether the running kernel supports a block size smaller than the page
size.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
Documentation/ABI/testing/sysfs-fs-f2fs | 2 +-
fs/f2fs/sysfs.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index e7e968c6df92..33948ebc560c 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -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, resizable_tail.
+ fserror, metadata_cache, resizable_tail, subpage_block.
What: /sys/fs/f2fs/<disk>/inject_rate
Date: May 2016
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 430356e500af..1325985e8df7 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -1428,6 +1428,7 @@ F2FS_FEATURE_RO_ATTR(packed_ssa);
F2FS_FEATURE_RO_ATTR(fserror);
F2FS_FEATURE_RO_ATTR(metadata_cache);
F2FS_FEATURE_RO_ATTR(resizable_tail);
+F2FS_FEATURE_RO_ATTR(subpage_block);
#define ATTR_LIST(name) (&f2fs_attr_##name.attr)
static struct attribute *f2fs_attrs[] = {
@@ -1604,6 +1605,7 @@ static struct attribute *f2fs_feat_attrs[] = {
BASE_ATTR_LIST(fserror),
BASE_ATTR_LIST(metadata_cache),
BASE_ATTR_LIST(resizable_tail),
+ BASE_ATTR_LIST(subpage_block),
NULL,
};
ATTRIBUTE_GROUPS(f2fs_feat);
--
2.56.1.915.g69d5ec7298-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] f2fs: expose subpage_block feature via sysfs
@ 2026-12-02 21:45 ` Daeho Jeong
0 siblings, 0 replies; 2+ messages in thread
From: Daeho Jeong @ 2026-12-02 21:45 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
From: Daeho Jeong <daehojeong@google.com>
f2fs can mount a filesystem whose block size is smaller than the page
size, down to 4KB. A kernel without this support rejects such a
filesystem at mount time, and userspace has no way to tell the two
apart. A tool that formats a device needs to know it before picking the
block size, e.g. to choose between 4KB and 16KB blocks on a 16KB page
kernel.
Add /sys/fs/f2fs/features/subpage_block, so that userspace can check
whether the running kernel supports a block size smaller than the page
size.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
Documentation/ABI/testing/sysfs-fs-f2fs | 2 +-
fs/f2fs/sysfs.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index e7e968c6df92..33948ebc560c 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -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, resizable_tail.
+ fserror, metadata_cache, resizable_tail, subpage_block.
What: /sys/fs/f2fs/<disk>/inject_rate
Date: May 2016
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index 430356e500af..1325985e8df7 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -1428,6 +1428,7 @@ F2FS_FEATURE_RO_ATTR(packed_ssa);
F2FS_FEATURE_RO_ATTR(fserror);
F2FS_FEATURE_RO_ATTR(metadata_cache);
F2FS_FEATURE_RO_ATTR(resizable_tail);
+F2FS_FEATURE_RO_ATTR(subpage_block);
#define ATTR_LIST(name) (&f2fs_attr_##name.attr)
static struct attribute *f2fs_attrs[] = {
@@ -1604,6 +1605,7 @@ static struct attribute *f2fs_feat_attrs[] = {
BASE_ATTR_LIST(fserror),
BASE_ATTR_LIST(metadata_cache),
BASE_ATTR_LIST(resizable_tail),
+ BASE_ATTR_LIST(subpage_block),
NULL,
};
ATTRIBUTE_GROUPS(f2fs_feat);
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-02 21:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 21:45 [f2fs-dev] [PATCH] f2fs: expose subpage_block feature via sysfs Daeho Jeong
2026-12-02 21:45 ` Daeho Jeong
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.