summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-01-05 00:09:50 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-05 00:09:50 -0900
commit95d5f0f06e9551ef7617ca5bf31b036738ba6dce (patch)
tree7dd8fec208b875af9af3b95e873c802e1dc54b90
parent69973b830859bc6529a7a0468ba0d80ee5117826 (diff)
downloadlinux-bcache-bcache-continue-on-btree-node-error.tar.zst
bcache: continue on btree node error (hopefully)bcache-continue-on-btree-node-error
-rw-r--r--drivers/md/bcache/btree.c14
-rw-r--r--drivers/md/bcache/super.c2
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 81d3db40cd7b..4e9fe475d362 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1524,6 +1524,9 @@ static int btree_gc_recurse(struct btree *b, struct btree_op *op,
if (k) {
r->b = bch_btree_node_get(b->c, op, k, b->level - 1,
true, b);
+ if (IS_ERR(r->b) && PTR_ERR(r->b) == -EIO)
+ continue;
+
if (IS_ERR(r->b)) {
ret = PTR_ERR(r->b);
break;
@@ -1820,8 +1823,11 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op)
if (k)
btree_node_prefetch(b, k);
- if (p)
+ if (p) {
ret = btree(check_recurse, p, b, op);
+ if (ret == -EIO)
+ ret = 0;
+ }
p = k;
} while (p && !ret);
@@ -2277,6 +2283,9 @@ static int bch_btree_map_nodes_recurse(struct btree *b, struct btree_op *op,
op, from, fn, flags);
from = NULL;
+ if (ret == -EIO)
+ ret = MAP_CONTINUE;
+
if (ret != MAP_CONTINUE)
return ret;
}
@@ -2310,6 +2319,9 @@ static int bch_btree_map_keys_recurse(struct btree *b, struct btree_op *op,
: btree(map_keys_recurse, k, b, op, from, fn, flags);
from = NULL;
+ if (ret == -EIO)
+ ret = MAP_CONTINUE;
+
if (ret != MAP_CONTINUE)
return ret;
}
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 849ad441cd76..d08ffa9c4139 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1311,7 +1311,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...)
if (c->on_error == ON_ERROR_PANIC)
panic("panic forced after error\n");
- bch_cache_set_unregister(c);
+ //bch_cache_set_unregister(c);
return true;
}