f2fs: fix to recover old fault injection config in ->remount_fs
authorChao Yu <yuchao0@huawei.com>
Mon, 26 Sep 2016 11:45:06 +0000 (19:45 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 1 Oct 2016 00:34:34 +0000 (17:34 -0700)
In ->remount_fs, we didn't recover original fault injection config if
we encounter error, fix it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 785d0fdf6e762e0bb2333883cfef992580d6e9e6..40aecd78ccccd77db09e5d32c31676b9fd6c9c37 100644 (file)
@@ -1000,6 +1000,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
        bool need_restart_gc = false;
        bool need_stop_gc = false;
        bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE);
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+       struct f2fs_fault_info ffi = sbi->fault_info;
+#endif
 
        /*
         * Save the old mount options in case we
@@ -1095,6 +1098,9 @@ restore_gc:
 restore_opts:
        sbi->mount_opt = org_mount_opt;
        sbi->active_logs = active_logs;
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+       sbi->fault_info = ffi;
+#endif
        return err;
 }