summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/opts.h3
-rw-r--r--drivers/md/bcache/super.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/bcache/opts.h b/drivers/md/bcache/opts.h
index bd490aa91b79..7ef0124f1beb 100644
--- a/drivers/md/bcache/opts.h
+++ b/drivers/md/bcache/opts.h
@@ -38,6 +38,9 @@ LE64_BITMASK(NO_SB_OPT, struct cache_sb, flags, 0, 0);
CACHE_SET_OPT(journal_flush_disabled, \
bch_bool_opt, 0, 2, \
NO_SB_OPT, true) \
+ CACHE_SET_OPT(nofsck, \
+ bch_bool_opt, 0, 2, \
+ NO_SB_OPT, true) \
CACHE_SET_SB_OPTS()
#define CACHE_SET_OPTS() \
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 0ac28a458f37..b4f6e6b0c7a7 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1356,9 +1356,11 @@ static const char *run_cache_set(struct cache_set *c)
bch_verbose(c, "fs gc done");
- bch_verbose(c, "starting fsck:");
- bch_fsck(c);
- bch_verbose(c, "fsck done");
+ if (!c->opts.nofsck) {
+ bch_verbose(c, "starting fsck:");
+ bch_fsck(c);
+ bch_verbose(c, "fsck done");
+ }
} else {
struct bkey_i_inode inode;
struct closure cl;