| From 493efe3f1970f51cd727bfdcf925bc853fe89e47 Mon Sep 17 00:00:00 2001 |
| From: Chao Yu <yuchao0@huawei.com> |
| Date: Fri, 14 Feb 2020 17:45:11 +0800 |
| Subject: [PATCH] f2fs: fix to show norecovery mount option |
| |
| commit a9117eca1de6b738e713d2142126db2cfbf6fb36 upstream. |
| |
| Previously, 'norecovery' mount option will be shown as |
| 'disable_roll_forward', fix to show original option name correctly. |
| |
| Signed-off-by: Chao Yu <yuchao0@huawei.com> |
| Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h |
| index 6744f29997a9..dfb70a0e2fc9 100644 |
| --- a/fs/f2fs/f2fs.h |
| +++ b/fs/f2fs/f2fs.h |
| @@ -99,6 +99,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; |
| #define F2FS_MOUNT_INLINE_XATTR_SIZE 0x00800000 |
| #define F2FS_MOUNT_RESERVE_ROOT 0x01000000 |
| #define F2FS_MOUNT_DISABLE_CHECKPOINT 0x02000000 |
| +#define F2FS_MOUNT_NORECOVERY 0x04000000 |
| |
| #define F2FS_OPTION(sbi) ((sbi)->mount_opt) |
| #define clear_opt(sbi, option) (F2FS_OPTION(sbi).opt &= ~F2FS_MOUNT_##option) |
| diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c |
| index 7311df665eac..d3c0e4ece4cf 100644 |
| --- a/fs/f2fs/super.c |
| +++ b/fs/f2fs/super.c |
| @@ -409,7 +409,7 @@ static int parse_options(struct super_block *sb, char *options) |
| break; |
| case Opt_norecovery: |
| /* this option mounts f2fs with ro */ |
| - set_opt(sbi, DISABLE_ROLL_FORWARD); |
| + set_opt(sbi, NORECOVERY); |
| if (!f2fs_readonly(sb)) |
| return -EINVAL; |
| break; |
| @@ -1327,6 +1327,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) |
| } |
| if (test_opt(sbi, DISABLE_ROLL_FORWARD)) |
| seq_puts(seq, ",disable_roll_forward"); |
| + if (test_opt(sbi, NORECOVERY)) |
| + seq_puts(seq, ",norecovery"); |
| if (test_opt(sbi, DISCARD)) |
| seq_puts(seq, ",discard"); |
| if (test_opt(sbi, NOHEAP)) |
| @@ -3401,7 +3403,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) |
| goto reset_checkpoint; |
| |
| /* recover fsynced data */ |
| - if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) { |
| + if (!test_opt(sbi, DISABLE_ROLL_FORWARD) && |
| + !test_opt(sbi, NORECOVERY)) { |
| /* |
| * mount should be failed, when device has readonly mode, and |
| * previous checkpoint was not done by clean system shutdown. |
| -- |
| 2.7.4 |
| |