aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-08-08 18:37:41 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-08-21 12:21:00 -0400
commited2e621a95d704e6a4e904cc00524e8cbddda0c2 (patch)
tree9eff19a30572ae26c7c00af6da7b22e376cb276a /fs
parent6f12ac25f0167adb5d9ad5547fd6838380261e5c (diff)
f2fs: give a chance to mount again when encountering errors
This patch gives another chance to try mount process when we encounter an error. This makes an effect on the roll-forward recovery failures as well. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/super.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 7a5477915d99..e161e13958e2 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -902,8 +902,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
902 struct buffer_head *raw_super_buf; 902 struct buffer_head *raw_super_buf;
903 struct inode *root; 903 struct inode *root;
904 long err = -EINVAL; 904 long err = -EINVAL;
905 bool retry = true;
905 int i; 906 int i;
906 907
908try_onemore:
907 /* allocate memory for f2fs-specific super block info */ 909 /* allocate memory for f2fs-specific super block info */
908 sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL); 910 sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL);
909 if (!sbi) 911 if (!sbi)
@@ -1083,9 +1085,11 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
1083 /* recover fsynced data */ 1085 /* recover fsynced data */
1084 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) { 1086 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) {
1085 err = recover_fsync_data(sbi); 1087 err = recover_fsync_data(sbi);
1086 if (err) 1088 if (err) {
1087 f2fs_msg(sb, KERN_ERR, 1089 f2fs_msg(sb, KERN_ERR,
1088 "Cannot recover all fsync data errno=%ld", err); 1090 "Cannot recover all fsync data errno=%ld", err);
1091 goto free_kobj;
1092 }
1089 } 1093 }
1090 1094
1091 /* 1095 /*
@@ -1126,6 +1130,13 @@ free_sb_buf:
1126 brelse(raw_super_buf); 1130 brelse(raw_super_buf);
1127free_sbi: 1131free_sbi:
1128 kfree(sbi); 1132 kfree(sbi);
1133
1134 /* give only one another chance */
1135 if (retry) {
1136 retry = !retry;
1137 shrink_dcache_sb(sb);
1138 goto try_onemore;
1139 }
1129 return err; 1140 return err;
1130} 1141}
1131 1142