aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-03-16 09:08:44 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-10 18:08:43 -0400
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)
966 struct buffer_head *raw_super_buf; 966 struct buffer_head *raw_super_buf;
967 struct inode *root; 967 struct inode *root;
968 long err = -EINVAL; 968 long err = -EINVAL;
969 bool retry = true; 969 bool retry = true, need_fsck = false;
970 char *options = NULL; 970 char *options = NULL;
971 int i; 971 int i;
972 972
@@ -1155,9 +1155,6 @@ try_onemore:
1155 if (err) 1155 if (err)
1156 goto free_proc; 1156 goto free_proc;
1157 1157
1158 if (!retry)
1159 set_sbi_flag(sbi, SBI_NEED_FSCK);
1160
1161 /* recover fsynced data */ 1158 /* recover fsynced data */
1162 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) { 1159 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) {
1163 /* 1160 /*
@@ -1169,8 +1166,13 @@ try_onemore:
1169 err = -EROFS; 1166 err = -EROFS;
1170 goto free_kobj; 1167 goto free_kobj;
1171 } 1168 }
1169
1170 if (need_fsck)
1171 set_sbi_flag(sbi, SBI_NEED_FSCK);
1172
1172 err = recover_fsync_data(sbi); 1173 err = recover_fsync_data(sbi);
1173 if (err) { 1174 if (err) {
1175 need_fsck = true;
1174 f2fs_msg(sb, KERN_ERR, 1176 f2fs_msg(sb, KERN_ERR,
1175 "Cannot recover all fsync data errno=%ld", err); 1177 "Cannot recover all fsync data errno=%ld", err);
1176 goto free_kobj; 1178 goto free_kobj;