Skip to contentSkip to conversation

f2fs: fix to show injection rate in ->show_options

PATCH New Chao Yu 1 participant 4 messages Jun 12, 2017

Subsystems (2)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/4 f2fs: fix to show injection rate in ->show_options

If fault injection functionality is enabled, show additional injection rate in ->show_options.

---
 fs/f2fs/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/super.c +2 -1
index 02cda00284e1..1c05763616b2 100644
@@ -995,7 +995,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 		seq_printf(seq, ",io_size=%uKB", F2FS_IO_SIZE_KB(sbi));
 #ifdef CONFIG_F2FS_FAULT_INJECTION
 	if (test_opt(sbi, FAULT_INJECTION))
-		seq_puts(seq, ",fault_injection");
+		seq_printf(seq, ",fault_injection=%u",
+				sbi->fault_info.inject_rate);
 #endif
 #ifdef CONFIG_FS_DAX
 	if (test_opt(sbi, DAX))
Signature · 6 lines
2.13.1.388.g69e6b9b4f4a9


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
author
#1 lore raw

PATCH 2/4 f2fs: fix to document fault injection option and sysfs file

Commit 73faec4d9935 ("f2fs: add mount option to select fault injection ratio") and Commit 087968974fcd ("f2fs: add fault injection to sysfs") forget to document mount option and sysfs file.

This patch fixes to document them.

---
 Documentation/ABI/testing/sysfs-fs-f2fs | 12 ++++++++++++
 Documentation/filesystems/f2fs.txt      |  2 ++
 2 files changed, 14 insertions(+)
Documentation/ABI/testing/sysfs-fs-f2fs +12 -0
index a809f6005f14..ae59451865a6 100644
@@ -112,3 +112,15 @@ Date:		January 2016
 Contact:	"Shuoran Liu" <[email protected]>
 Description:
 		 Shows total written kbytes issued to disk.
+
+What:		/sys/fs/f2fs/<disk>/injection_rate
+Date:		May 2016
+Contact:	"Sheng Yong" <[email protected]>
+Description:
+		 Contrils the injection rate.
+
+What:		/sys/fs/f2fs/<disk>/injection_type
+Date:		May 2016
+Contact:	"Sheng Yong" <[email protected]>
+Description:
+		 Contrils the injection type.
Documentation/filesystems/f2fs.txt +2 -0
index 4f6531a4701b..8b04a6359530 100644
@@ -155,6 +155,8 @@ noinline_data          Disable the inline data feature, inline data feature is
                        enabled by default.
 data_flush             Enable data flushing before checkpoint in order to
                        persist data of regular and symlink.
+fault_injection=%d     Enable fault injection in all supported types with
+                       specified injection rate.
 mode=%s                Control block allocation mode which supports "adaptive"
                        and "lfs". In "lfs" mode, there should be no random
                        writes towards main area.
Signature · 6 lines
2.13.1.388.g69e6b9b4f4a9


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
author
#2 lore raw

PATCH 3/4 f2fs: fix incorrect document of batched_trim_sections

In reply to Chao Yu
---
 Documentation/ABI/testing/sysfs-fs-f2fs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-fs-f2fs +1 -1
index ae59451865a6..ffe97abd080a 100644
@@ -75,7 +75,7 @@ Contact:	"Jaegeuk Kim" <[email protected]>
 Description:
 		 Controls the memory footprint used by f2fs.
 
-What:		/sys/fs/f2fs/<disk>/trim_sections
+What:		/sys/fs/f2fs/<disk>/batched_trim_sections
 Date:		February 2015
 Contact:	"Jaegeuk Kim" <[email protected]>
 Description:
Signature · 6 lines
2.13.1.388.g69e6b9b4f4a9


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
author
#3 lore raw

PATCH 4/4 f2fs: fix wrong error number of fill_super

In reply to Chao Yu

This patch fixes incorrect error number in error path of fill_super.

---
 fs/f2fs/super.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/f2fs/super.c +4 -1
index 1c05763616b2..b26ae4d648cb 100644
@@ -1945,6 +1945,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	if (f2fs_sb_mounted_blkzoned(sb)) {
 		f2fs_msg(sb, KERN_ERR,
 			 "Zoned block device support is not enabled\n");
+		err = -EOPNOTSUPP;
 		goto free_sb_buf;
 	}
 #endif
@@ -2016,8 +2017,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	if (F2FS_IO_SIZE(sbi) > 1) {
 		sbi->write_io_dummy =
 			mempool_create_page_pool(2 * (F2FS_IO_SIZE(sbi) - 1), 0);
-		if (!sbi->write_io_dummy)
+		if (!sbi->write_io_dummy) {
+			err = -ENOMEM;
 			goto free_options;
+		}
 	}
 
 	/* get an inode for meta space */
Signature · 6 lines
2.13.1.388.g69e6b9b4f4a9


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot