summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-12-23 18:09:18 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-18 21:41:33 -0900
commitda938135e15bcc078f26433403766fec145512df (patch)
tree54199124a30dbb0e1c5e829cbc6fa9521ccf66cb
parent8d8f1adfb5a592283cdb9966d6dbf718a5b90652 (diff)
bcache: fix run_cache_set error handling
-rw-r--r--drivers/md/bcache/super.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index d526928b8ae9..cf27f0c18d16 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1497,33 +1497,32 @@ static const char *run_cache_set(struct cache_set *c)
err:
switch (ret) {
case BCH_FSCK_ERRORS_NOT_FIXED:
- err = NULL;
bch_err(c, "filesystem contains errors: please report this to the developers");
pr_cont("mount with -o fix_errors to repair");
+ err = "fsck error";
break;
case BCH_FSCK_REPAIR_UNIMPLEMENTED:
- err = NULL;
bch_err(c, "filesystem contains errors: please report this to the developers");
pr_cont("repair unimplemented: inform the developers so that it can be added");
+ err = "fsck error";
break;
case BCH_FSCK_REPAIR_IMPOSSIBLE:
- err = NULL;
bch_err(c, "filesystem contains errors, but repair impossible");
+ err = "fsck error";
break;
case BCH_FSCK_UNKNOWN_VERSION:
- err = NULL;
- bch_err(c, "cannot mount: unknown metadata version");
+ err = "unknown metadata version";;
break;
case -ENOMEM:
- err = NULL;
- bch_err(c, "cannot mount: insufficient memory");
+ err = "cannot allocate memory";
break;
case -EIO:
- err = NULL;
- bch_err(c, "cannot mount: IO error");
+ err = "IO error";
break;
}
+ BUG_ON(!err);
+
bch_journal_entries_free(&journal);
set_bit(CACHE_SET_ERROR, &c->flags);
bch_cache_set_unregister(c);