On Fri, Jun 04, 2021 at 08:27:32AM +0000, David Laight wrote:
From: Jaegeuk Kim
Sent: 04 June 2021 05:45
...
@@ -161,6 +161,9 @@ static ssize_t features_show(struct f2fs_attr *a, if (f2fs_sb_has_compression(sbi)) len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s", len ? ", " : "", "compression");
- if (f2fs_sb_has_casefold(sbi) && f2fs_sb_has_encrypt(sbi))
len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s",
len += scnprintf(buf + len, PAGE_SIZE - len, "%s%s", len ? ", " : "", "pin_file"); len += scnprintf(buf + len, PAGE_SIZE - len, "\n");len ? ", " : "", "encrypted_casefold");
Looking at that pattern, why don't you just append "tag, " each time and then replace the final ", " with "\n" at the end.
Again PLEASE NO!
This is not how sysfs is supposed to work and do not perpetuate this mess in any way.
greg k-h