summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChengguang Xu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>2019-09-27 09:35:48 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2019-10-22 10:32:36 -0700
commited3520427f57327f581de0cc28c1c30df08f0103 (patch)
tree9d20d1939e90c3a188a3b8e0d368d8d16ad42ce5 /fs/f2fs
parentfe1897eaa6646f5a64a4cee0e6473ed9887d324b (diff)
downloadlinux-ed3520427f57327f581de0cc28c1c30df08f0103.tar.bz2
f2fs: mark recovery flag correctly in read_raw_super_block()
On the combination of first fail and second success, we will miss to mark recovery flag because currently we reuse err variable in the loop. Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 1443cee15863..f3a68af3b43a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2951,6 +2951,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Unable to read %dth superblock",
block + 1);
err = -EIO;
+ *recovery = 1;
continue;
}
@@ -2960,6 +2961,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock",
block + 1);
brelse(bh);
+ *recovery = 1;
continue;
}
@@ -2972,10 +2974,6 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
brelse(bh);
}
- /* Fail to read any one of the superblocks*/
- if (err < 0)
- *recovery = 1;
-
/* No valid superblock */
if (!*raw_super)
kvfree(super);