aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu2015-03-16 21:08:44 +0800
committerJaegeuk Kim2015-04-10 15:08:43 -0700
commit2adc3505cfb819c91855a64d997a7cdd9731ee6e (patch)
tree720b8d875181083f560e6a82d72d72dd2e16f18e
parent21cb1d99bcc77252e6426010bcc6433f75b581bb (diff)
f2fs: set SBI_NEED_FSCK when encountering exception in recovery
This patch tries to set SBI_NEED_FSCK flag into sbi only when we fail to recover in fill_super, so we could skip fscking image when we fail to fill super for other reason. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/super.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0b8a2d8efa72..f9dc543805d9 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -966,7 +966,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
struct buffer_head *raw_super_buf;
struct inode *root;
long err = -EINVAL;
- bool retry = true;
+ bool retry = true, need_fsck = false;
char *options = NULL;
int i;
@@ -1155,9 +1155,6 @@ try_onemore:
if (err)
goto free_proc;
- if (!retry)
- set_sbi_flag(sbi, SBI_NEED_FSCK);
-
/* recover fsynced data */
if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) {
/*
@@ -1169,8 +1166,13 @@ try_onemore:
err = -EROFS;
goto free_kobj;
}
+
+ if (need_fsck)
+ set_sbi_flag(sbi, SBI_NEED_FSCK);
+
err = recover_fsync_data(sbi);
if (err) {
+ need_fsck = true;
f2fs_msg(sb, KERN_ERR,
"Cannot recover all fsync data errno=%ld", err);
goto free_kobj;