summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-03-23 16:12:58 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-04-15 08:49:47 -0700
commit6781eabba1bdb133eb9125c4acf6704ccbe4df02 (patch)
treef20bf831b5fdfc4390beae29976a6f90dda1502f /fs/f2fs/recovery.c
parentdf728b0f6954c38545f4bf12dedeeb9e07469a94 (diff)
downloadlinux-6781eabba1bdb133eb9125c4acf6704ccbe4df02.tar.gz
linux-6781eabba1bdb133eb9125c4acf6704ccbe4df02.tar.bz2
linux-6781eabba1bdb133eb9125c4acf6704ccbe4df02.zip
f2fs: give -EINVAL for norecovery and rw mount
Once detecting something to recover, f2fs should stop mounting, given norecovery and rw mount options. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 011942f94d64..2c87c12b6f1c 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -551,12 +551,13 @@ next:
return err;
}
-int recover_fsync_data(struct f2fs_sb_info *sbi)
+int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
{
struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_WARM_NODE);
struct list_head inode_list;
block_t blkaddr;
int err;
+ int ret = 0;
bool need_writecp = false;
fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry",
@@ -573,11 +574,13 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
/* step #1: find fsynced inode numbers */
err = find_fsync_dnodes(sbi, &inode_list);
- if (err)
+ if (err || list_empty(&inode_list))
goto out;
- if (list_empty(&inode_list))
+ if (check_only) {
+ ret = 1;
goto out;
+ }
need_writecp = true;
@@ -625,5 +628,5 @@ out:
} else {
mutex_unlock(&sbi->cp_mutex);
}
- return err;
+ return ret ? ret: err;
}