> Has anybody ever tested bcache against power loss? We have had to hard reset our machine many times during the process of troubleshooting various lockups that have been since resolved by some of the patches posted to this list (attached). I did notice in the logs that it said something about replaying transactions when it came up after a hard reset, so that is promising. Still, we reformatted all of our bcache volumes after the lockups were resolved just to make sure that there were no unexpected side effects and have not had any issues since. > Stefan > -- > To unsubscribe from this list: send the line "unsubscribe linux-bcache" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html >
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 00cde40..d14560a 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -2162,8 +2162,10 @@ int bch_btree_insert_check_key(struct btree *b, struct btree_op *op, rw_lock(true, b, b->level); if (b->key.ptr[0] != btree_ptr || - b->seq != seq + 1) + b->seq != seq + 1) { + op->lock = b->c->root->level + 1; goto out; + } } SET_KEY_PTRS(check_key, 1); -- 1.7.1
--- a/drivers/md/bcache/btree.c 2014-11-03 16:51:01.720000000 -0800 +++ b/drivers/md/bcache/btree.c 2014-11-03 16:51:26.456000000 -0800 @@ -1741,6 +1741,7 @@ do { ret = btree_root(gc_root, c, &op, &writes, &stats); closure_sync(&writes); + cond_resched(); if (ret && ret != -EAGAIN) pr_warn("gc failed!");