summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/bcache.h1
-rw-r--r--drivers/md/bcache/error.c2
-rw-r--r--drivers/md/bcache/super.c4
3 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index f8a3ab43e841..1507fe4d5047 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -489,6 +489,7 @@ enum {
CACHE_SET_GC_STOPPING,
CACHE_SET_GC_FAILURE,
CACHE_SET_BDEV_MOUNTED,
+ CACHE_SET_ERROR,
};
struct btree_debug {
diff --git a/drivers/md/bcache/error.c b/drivers/md/bcache/error.c
index 31221d5008d9..9ba33ef6aaae 100644
--- a/drivers/md/bcache/error.c
+++ b/drivers/md/bcache/error.c
@@ -6,6 +6,8 @@
void bch_inconsistent_error(struct cache_set *c)
{
+ set_bit(CACHE_SET_ERROR, &c->flags);
+
switch (c->opts.errors) {
case BCH_ON_ERROR_CONTINUE:
break;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 1b0663297fab..6275f708e555 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -744,7 +744,8 @@ static void bch_cache_set_read_only_work(struct work_struct *work)
__bch_cache_set_read_only(c);
- if (!bch_journal_error(&c->journal)) {
+ if (!bch_journal_error(&c->journal) &&
+ !test_bit(CACHE_SET_ERROR, &c->flags)) {
SET_CACHE_SET_CLEAN(&c->disk_sb, true);
bcache_write_super(c);
}
@@ -1470,6 +1471,7 @@ err:
kfree(r);
}
+ set_bit(CACHE_SET_ERROR, &c->flags);
bch_cache_set_unregister(c);
closure_put(&c->caching);
return err;