]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
f2fs: fix to show norecovery mount option
authorChao Yu <yuchao0@huawei.com>
Fri, 14 Feb 2020 09:45:11 +0000 (17:45 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:41:19 +0000 (10:41 +0200)
BugLink: https://bugs.launchpad.net/bugs/1875660
[ Upstream commit a9117eca1de6b738e713d2142126db2cfbf6fb36 ]

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: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/f2fs/f2fs.h
fs/f2fs/super.c

index 1a8b68ceaa62f435bc8c8c396301e2e91359ae35..3edde3d6d089d38d8b51fbb21dea1a2d3c253cc7 100644 (file)
@@ -100,6 +100,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)
index 28441f4971b8ddf77c781e922b2be2fc0e7b31ab..94caf26901e0bc8492aebfb4cbb5aa44a41f0294 100644 (file)
@@ -439,7 +439,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;
@@ -1348,6 +1348,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");
        else
@@ -3488,7 +3490,8 @@ try_onemore:
                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.