aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-01-23 21:33:46 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2015-02-11 20:04:40 -0500
commit2d834bf9ac8e40d9ae2a2dcde2348bd028f87ec4 (patch)
tree3488fad8e7a8c90363355b2265f69d9fd07c3da9
parentdabc4a5c60f796a8e7171272284ba077f9c1e439 (diff)
f2fs: support norecovery mount option
This patch adds a mount option, norecovery, which is mostly same as disable_roll_forward. The only difference is that norecovery should be activated with read-only mount option. This can be used when user wants to check whether f2fs is mountable or not without any recovery process. (e.g., xfstests/200) Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--Documentation/filesystems/f2fs.txt2
-rw-r--r--fs/f2fs/super.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index e0950c483c22..6758aa358475 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -106,6 +106,8 @@ background_gc=%s Turn on/off cleaning operations, namely garbage
106 Default value for this option is on. So garbage 106 Default value for this option is on. So garbage
107 collection is on by default. 107 collection is on by default.
108disable_roll_forward Disable the roll-forward recovery routine 108disable_roll_forward Disable the roll-forward recovery routine
109norecovery Disable the roll-forward recovery routine, mounted read-
110 only (i.e., -o ro,disable_roll_forward)
109discard Issue discard/TRIM commands when a segment is cleaned. 111discard Issue discard/TRIM commands when a segment is cleaned.
110no_heap Disable heap-style segment allocation which finds free 112no_heap Disable heap-style segment allocation which finds free
111 segments for data from the beginning of main area, while 113 segments for data from the beginning of main area, while
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 146e310fbf04..06d903b5d6c8 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -42,6 +42,7 @@ static struct kset *f2fs_kset;
42enum { 42enum {
43 Opt_gc_background, 43 Opt_gc_background,
44 Opt_disable_roll_forward, 44 Opt_disable_roll_forward,
45 Opt_norecovery,
45 Opt_discard, 46 Opt_discard,
46 Opt_noheap, 47 Opt_noheap,
47 Opt_user_xattr, 48 Opt_user_xattr,
@@ -62,6 +63,7 @@ enum {
62static match_table_t f2fs_tokens = { 63static match_table_t f2fs_tokens = {
63 {Opt_gc_background, "background_gc=%s"}, 64 {Opt_gc_background, "background_gc=%s"},
64 {Opt_disable_roll_forward, "disable_roll_forward"}, 65 {Opt_disable_roll_forward, "disable_roll_forward"},
66 {Opt_norecovery, "norecovery"},
65 {Opt_discard, "discard"}, 67 {Opt_discard, "discard"},
66 {Opt_noheap, "no_heap"}, 68 {Opt_noheap, "no_heap"},
67 {Opt_user_xattr, "user_xattr"}, 69 {Opt_user_xattr, "user_xattr"},
@@ -287,6 +289,12 @@ static int parse_options(struct super_block *sb, char *options)
287 case Opt_disable_roll_forward: 289 case Opt_disable_roll_forward:
288 set_opt(sbi, DISABLE_ROLL_FORWARD); 290 set_opt(sbi, DISABLE_ROLL_FORWARD);
289 break; 291 break;
292 case Opt_norecovery:
293 /* this option mounts f2fs with ro */
294 set_opt(sbi, DISABLE_ROLL_FORWARD);
295 if (!f2fs_readonly(sb))
296 return -EINVAL;
297 break;
290 case Opt_discard: 298 case Opt_discard:
291 set_opt(sbi, DISCARD); 299 set_opt(sbi, DISCARD);
292 break; 300 break;