f2fs: Advertise encrypted casefolding in sysfs
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/3 f2fs: Advertise encrypted casefolding in sysfs
From: Daniel Rosenberg <[email protected]>
Older kernels don't support encryption with casefolding. This adds the sysfs entry encrypted_casefold to show support for those combined features. Support for this feature was originally added by commit 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption")
--- fs/f2fs/sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/f2fs/sysfs.c +8 -0
@@ -583,6 +583,7 @@ enum feat_id {FEAT_COMPRESSION ,FEAT_RO ,FEAT_TEST_DUMMY_ENCRYPTION_V2 , + FEAT_ENCRYPTED_CASEFOLD, }; static ssize_t f2fs_feature_show(struct f2fs_attr *a,
@@ -605,6 +606,7 @@ static ssize_t f2fs_feature_show(struct f2fs_attr *a,case FEAT_COMPRESSION :case FEAT_RO :case FEAT_TEST_DUMMY_ENCRYPTION_V2 : +case FEAT_ENCRYPTED_CASEFOLD :return sprintf (buf,"supported\n" ); }return 0 ;
@@ -709,7 +711,10 @@ F2FS_GENERAL_RO_ATTR(avg_vblocks);#ifdef CONFIG_FS_ENCRYPTION F2FS_FEATURE_RO_ATTR (encryption,FEAT_CRYPTO );F2FS_FEATURE_RO_ATTR (test_dummy_encryption_v2,FEAT_TEST_DUMMY_ENCRYPTION_V2 ); +#ifdef CONFIG_UNICODE +F2FS_FEATURE_RO_ATTR (encrypted_casefold,FEAT_ENCRYPTED_CASEFOLD );#endif +#endif /* CONFIG_FS_ENCRYPTION */ #ifdef CONFIG_BLK_DEV_ZONED F2FS_FEATURE_RO_ATTR (block_zoned,FEAT_BLKZONED );#endif
@@ -822,7 +827,10 @@ static struct attribute *f2fs_feat_attrs[] = {#ifdef CONFIG_FS_ENCRYPTION ATTR_LIST(encryption), ATTR_LIST(test_dummy_encryption_v2), +#ifdef CONFIG_UNICODE + ATTR_LIST(encrypted_casefold),#endif +#endif /* CONFIG_FS_ENCRYPTION */ #ifdef CONFIG_BLK_DEV_ZONED ATTR_LIST(block_zoned),#endif
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Jaegeuk Kim
maintainerPATCH 2/3 f2fs: add pin_file in feature list
This patch adds missing pin_file feature supported by kernel.
--- fs/f2fs/sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/sysfs.c +2 -0
@@ -740,6 +740,7 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, compr_written_block, compr_written_block);F2FS_RW_ATTR (F2FS_SBI , f2fs_sb_info, compr_saved_block, compr_saved_block);F2FS_RW_ATTR (F2FS_SBI , f2fs_sb_info, compr_new_inode, compr_new_inode);#endif +F2FS_FEATURE_RO_ATTR (pin_file);/* For ATGC */ F2FS_RW_ATTR (ATGC_INFO , atgc_management, atgc_candidate_ratio, candidate_ratio);
@@ -853,6 +854,7 @@ static struct attribute *f2fs_feat_attrs[] = {#ifdef CONFIG_F2FS_FS_COMPRESSION ATTR_LIST (compression), #endif +ATTR_LIST (pin_file),NULL , };ATTRIBUTE_GROUPS (f2fs_feat);
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Jaegeuk Kim
maintainerPATCH 3/3 f2fs: clean up /sys/fs/f2fs/<disk>/features
In reply to Jaegeuk KimLet's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.
Note that there are three feature list entries:
1) /sys/fs/f2fs/features
: shows runtime features supported by in-kernel f2fs along with Kconfig
- ref. F2FS_FEATURE_RO_ATTR()
2) /sys/fs/f2fs/$s_id/features <deprecated>
: shows on-disk features enabled by mkfs.f2fs, used for old kernels
3) /sys/fs/f2fs/$s_id/feature_list
: shows on-disk features enabled by mkfs.f2fs per instance.
this list covers old feature list provided by 2) and beyond
- ref. F2FS_SB_FEATURE_RO_ATTR()
--- Documentation/ABI/testing/sysfs-fs-f2fs | 29 +++- fs/f2fs/f2fs.h | 3 + fs/f2fs/sysfs.c | 191 ++++++++++++++++-------- 3 files changed, 159 insertions(+), 64 deletions(-)
Documentation/ABI/testing/sysfs-fs-f2fs +28 -1
@@ -203,7 +203,34 @@ Description: Shows total written kbytes issued to disk. What: /sys/fs/f2fs/<disk>/features Date: July 2017 Contact: "Jaegeuk Kim" <[email protected]> -Description: Shows all enabled features in current device. +Description: <deprecated: should use /sys/fs/f2fs/<disk>/feature_list/ + Shows all enabled features in current device. + Supported features: + encryption, blkzoned, extra_attr, projquota, inode_checksum, + flexible_inline_xattr, quota_ino, inode_crtime, lost_found, + verity, sb_checksum, casefold, readonly, compression, pin_file. + +What: /sys/fs/f2fs/<disk>/feature_list/ +Date: June 2021 +Contact: "Jaegeuk Kim" <[email protected]> +Description: Expand /sys/fs/f2fs/<disk>/features to meet sysfs rule. + Supported on-disk features: + encryption, block_zoned (aka blkzoned), extra_attr, + project_quota (aka projquota), inode_checksum, + flexible_inline_xattr, quota_ino, inode_crtime, lost_found, + verity, sb_checksum, casefold, readonly, compression. + Note that, pin_file is moved into /sys/fs/f2fs/features/. + +What: /sys/fs/f2fs/feature/ +Date: July 2017 +Contact: "Jaegeuk Kim" <[email protected]> +Description: Shows all enabled kernel features. + Supported features: + encryption, block_zoned, extra_attr, project_quota, + inode_checksum, flexible_inline_xattr, quota_ino, + inode_crtime, lost_found, verity, sb_checksum, + casefold, readonly, compression, test_dummy_encryption_v2, + atomic_write, pin_file, encrypted_casefold. What: /sys/fs/f2fs/<disk>/inject_rate Date: May 2016
fs/f2fs/f2fs.h +3 -0
@@ -1665,6 +1665,9 @@ struct f2fs_sb_info {struct kobject s_stat_kobj;/* /sys/fs/f2fs/<devname>/stat */ struct completion s_stat_kobj_unregister; +struct kobject s_feature_list_kobj;/* /sys/fs/f2fs/<devname>/feature_list */ +struct completion s_feature_list_kobj_unregister; +/* For shrinker support */ struct list_head s_list;int s_ndevs;/* number of devices */
fs/f2fs/sysfs.c +128 -63
254 lines not on this page · raw message
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Re: [f2fs-dev] [PATCH 3/3] f2fs: clean up /sys/fs/f2fs/<disk>/features
Quoted 1 line · Jaegeuk Kim
+What:
/sys/fs/f2fs/feature/
features/, not feature/.
Quoted 6 lines
+/*
+ * Note that there are three feature list entries:
+ * 1)/sys/fs/f2fs/features
+ * : shows runtime features supported by in-kernel f2fs along withKconfig
+ * - ref.F2FS_FEATURE_RO_ATTR()
+ *
Quoted 8 lines
+ * 2)
/sys/fs/f2fs/$s_id/features<deprecated>
+ * : shows on-disk features enabled by mkfs.f2fs, used for old kernels
+ *
+ * 3)/sys/fs/f2fs/$s_id/feature_list
+ * : shows on-disk features enabled by mkfs.f2fs per instance.
+ * this list covers old feature list provided by 2) and beyond
+ * - ref.F2FS_SB_FEATURE_RO_ATTR()
+ */
It would be helpful to make it clear which of these use the one-feature-per-file convention and which use the comma-separated features convention. And also whether future features will be listed in both (2) and (3), or just in (3).
Otherwise this patch looks good -- thanks!
- Eric
Jaegeuk Kim
maintainerRe: [PATCH 3/3 v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
In reply to Jaegeuk KimLet's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.
Note that there are three feature list entries:
1) /sys/fs/f2fs/features
: shows runtime features supported by in-kernel f2fs along with Kconfig.
- ref. F2FS_FEATURE_RO_ATTR()
2) /sys/fs/f2fs/$s_id/features <deprecated>
: shows on-disk features enabled by mkfs.f2fs, used for old kernels. This
won't add new feature anymore, and thus, users should check entries in 3) instead of this 2).
3) /sys/fs/f2fs/$s_id/feature_list
: shows on-disk features enabled by mkfs.f2fs per instance, which follows
sysfs entry rule where each entry should expose single value. This list covers old feature list provided by 2) and beyond. Therefore, please add new on-disk feature in this list only.
- ref. F2FS_SB_FEATURE_RO_ATTR()
---
change log from v1:
- adjust Eric's comment
Documentation/ABI/testing/sysfs-fs-f2fs | 29 +++- fs/f2fs/f2fs.h | 3 + fs/f2fs/sysfs.c | 196 ++++++++++++++++-------- 3 files changed, 163 insertions(+), 65 deletions(-)
Documentation/ABI/testing/sysfs-fs-f2fs +28 -1
@@ -203,7 +203,34 @@ Description: Shows total written kbytes issued to disk. What: /sys/fs/f2fs/<disk>/features Date: July 2017 Contact: "Jaegeuk Kim" <[email protected]> -Description: Shows all enabled features in current device. +Description: <deprecated: should use /sys/fs/f2fs/<disk>/feature_list/ + Shows all enabled features in current device. + Supported features: + encryption, blkzoned, extra_attr, projquota, inode_checksum, + flexible_inline_xattr, quota_ino, inode_crtime, lost_found, + verity, sb_checksum, casefold, readonly, compression, pin_file. + +What: /sys/fs/f2fs/<disk>/feature_list/ +Date: June 2021 +Contact: "Jaegeuk Kim" <[email protected]> +Description: Expand /sys/fs/f2fs/<disk>/features to meet sysfs rule. + Supported on-disk features: + encryption, block_zoned (aka blkzoned), extra_attr, + project_quota (aka projquota), inode_checksum, + flexible_inline_xattr, quota_ino, inode_crtime, lost_found, + verity, sb_checksum, casefold, readonly, compression. + Note that, pin_file is moved into /sys/fs/f2fs/features/. + +What: /sys/fs/f2fs/features/ +Date: July 2017 +Contact: "Jaegeuk Kim" <[email protected]> +Description: Shows all enabled kernel features. + Supported features: + encryption, block_zoned, extra_attr, project_quota, + inode_checksum, flexible_inline_xattr, quota_ino, + inode_crtime, lost_found, verity, sb_checksum, + casefold, readonly, compression, test_dummy_encryption_v2, + atomic_write, pin_file, encrypted_casefold. What: /sys/fs/f2fs/<disk>/inject_rate Date: May 2016
fs/f2fs/f2fs.h +3 -0
@@ -1665,6 +1665,9 @@ struct f2fs_sb_info {struct kobject s_stat_kobj;/* /sys/fs/f2fs/<devname>/stat */ struct completion s_stat_kobj_unregister; +struct kobject s_feature_list_kobj;/* /sys/fs/f2fs/<devname>/feature_list */ +struct completion s_feature_list_kobj_unregister; +/* For shrinker support */ struct list_head s_list;int s_ndevs;/* number of devices */
fs/f2fs/sysfs.c +132 -64
258 lines not on this page · raw message
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Re: [f2fs-dev] [PATCH 2/3] f2fs: add pin_file in feature list
In reply to Jaegeuk KimQuoted 4 lines · Jaegeuk Kim
This patch adds missing
pin_filefeature supported by kernel.Fixes f5a53edcf01e ("f2fs: support aligned pinned file")Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
Re: [f2fs-dev] [PATCH 3/3 v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
In reply to Jaegeuk KimQuoted 12 lines · Jaegeuk Kim
Let's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.
Note that there are three feature list entries:
1)/sys/fs/f2fs/features
: shows runtime features supported by in-kernel f2fs along withKconfig.
- ref.F2FS_FEATURE_RO_ATTR()2)
/sys/fs/f2fs/$s_id/features<deprecated>
: shows on-disk features enabled by mkfs.f2fs, used for old kernels. This
won't add new feature anymore, and thus, users should check entries in 3) instead of this 2).
Quoted 8 lines
3)
/sys/fs/f2fs/$s_id/feature_list
: shows on-disk features enabled by mkfs.f2fs per instance, which follows
sysfs entry rule where each entry should expose single value. This list covers old feature list provided by 2) and beyond. Therefore, please add new on-disk feature in this list only.
- ref.F2FS_SB_FEATURE_RO_ATTR()Signed-off-by Jaegeuk Kim <[email protected]>
fs/f2fs/sysfs.c static struct kobj_type f2fs_stat_ktype = { · line 988
Quoted 7 lines
fs/f2fs/sysfs.c +7
-0+static struct kobj_type f2fs_feature_list_ktype = { + .default_groups = f2fs_sb_feat_groups, + .sysfs_ops = &f2fs_feature_list_attr_ops, + .release = f2fs_feature_list_kobj_release, +}; + +
Nitpick, one redundant blank line.
Thanks,
Jaegeuk Kim
maintainerRe: [f2fs-dev] [PATCH 3/3 v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
Quoted 24 lines · Chao Yu
Quoted 12 lines · Jaegeuk Kim
Let's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.
Note that there are three feature list entries:
1)/sys/fs/f2fs/features
: shows runtime features supported by in-kernel f2fs along withKconfig.
- ref.F2FS_FEATURE_RO_ATTR()2)
/sys/fs/f2fs/$s_id/features<deprecated>
: shows on-disk features enabled by mkfs.f2fs, used for old kernels. This
won't add new feature anymore, and thus, users should check entries in 3) instead of this 2).Quoted 8 lines
3)
/sys/fs/f2fs/$s_id/feature_list
: shows on-disk features enabled by mkfs.f2fs per instance, which follows
sysfs entry rule where each entry should expose single value. This list covers old feature list provided by 2) and beyond. Therefore, please add new on-disk feature in this list only.
- ref.F2FS_SB_FEATURE_RO_ATTR()Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>
Quoted 9 lines
fs/f2fs/sysfs.c static struct kobj_type f2fs_stat_ktype = { · line 988
Quoted 7 lines
fs/f2fs/sysfs.c +7
-0+static struct kobj_type f2fs_feature_list_ktype = { + .default_groups = f2fs_sb_feat_groups, + .sysfs_ops = &f2fs_feature_list_attr_ops, + .release = f2fs_feature_list_kobj_release, +}; + +Nitpick, one redundant blank line.
Done.
Quoted 2 lines
Thanks,
Eric Biggers
Reviewed-byRe: [f2fs-dev] [PATCH 3/3 v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
In reply to Jaegeuk KimQuoted 22 lines · Jaegeuk Kim
Let's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.
Note that there are three feature list entries:
1)/sys/fs/f2fs/features
: shows runtime features supported by in-kernel f2fs along withKconfig.
- ref.F2FS_FEATURE_RO_ATTR()2)
/sys/fs/f2fs/$s_id/features<deprecated>
: shows on-disk features enabled by mkfs.f2fs, used for old kernels. This
won't add new feature anymore, and thus, users should check entries in 3) instead of this 2).3)
/sys/fs/f2fs/$s_id/feature_list
: shows on-disk features enabled by mkfs.f2fs per instance, which follows
sysfs entry rule where each entry should expose single value. This list covers old feature list provided by 2) and beyond. Therefore, please add new on-disk feature in this list only.
- ref.F2FS_SB_FEATURE_RO_ATTR()Signed-off-by Jaegeuk Kim <[email protected]>---
Quoted 7 lines
change log from v1:
- adjust Eric's commentDocumentation/ABI/testing/sysfs-fs-f2fs | 29 +++- fs/f2fs/f2fs.h | 3 + fs/f2fs/sysfs.c | 196 ++++++++++++++++-------- 3 files changed, 163 insertions(+), 65 deletions(-)
- Eric