summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-10-05 22:39:58 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-10-07 12:37:19 -0800
commit9097e49827b0f9924e909341e8ab37f122ee65f9 (patch)
treeef448cbee7ba5659ad631ab5025eafd708868b24 /drivers/md/bcache/request.c
parentc705863383c74fafca5741a5da4b6f5b986ecfa4 (diff)
bcache: better error messages
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r--drivers/md/bcache/request.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index a2006bfa9f0c..71883352abd8 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -460,14 +460,16 @@ nopromote:
static void cached_dev_read(struct cached_dev *dc, struct search *s)
{
+ struct cache_set *c = s->iop.c;
struct closure *cl = &s->cl;
struct bio *bio = &s->rbio.bio;
struct btree_iter iter;
struct bkey_s_c k;
+ int ret;
- bch_increment_clock(s->iop.c, bio_sectors(bio), READ);
+ bch_increment_clock(c, bio_sectors(bio), READ);
- for_each_btree_key_with_holes(&iter, s->iop.c, BTREE_ID_EXTENTS,
+ for_each_btree_key_with_holes(&iter, c, BTREE_ID_EXTENTS,
POS(s->inode, bio->bi_iter.bi_sector), k) {
BKEY_PADDED(k) tmp;
struct extent_pick_ptr pick;
@@ -478,10 +480,9 @@ retry:
bch_btree_iter_unlock(&iter);
k = bkey_i_to_s_c(&tmp.k);
- bch_extent_pick_ptr(s->iop.c, k, &pick);
+ bch_extent_pick_ptr(c, k, &pick);
if (IS_ERR(pick.ca)) {
- bcache_io_error(s->iop.c, bio,
- "no device to read from");
+ bcache_io_error(c, bio, "no device to read from");
goto out;
}
@@ -493,12 +494,12 @@ retry:
if (pick.ca) {
PTR_BUCKET(pick.ca, &pick.ptr)->read_prio =
- s->iop.c->prio_clock[READ].hand;
+ c->prio_clock[READ].hand;
if (!bkey_extent_is_cached(k.k))
s->read_dirty_data = true;
- bch_read_extent(s->iop.c, &s->rbio, k, &pick,
+ bch_read_extent(c, &s->rbio, k, &pick,
BCH_READ_FORCE_BOUNCE|
BCH_READ_RETRY_IF_STALE|
(!s->bypass ? BCH_READ_PROMOTE : 0)|
@@ -524,8 +525,9 @@ retry:
* If we get here, it better have been because there was an error
* reading a btree node
*/
- BUG_ON(!bch_btree_iter_unlock(&iter));
- bcache_io_error(s->iop.c, bio, "btree IO error");
+ ret = bch_btree_iter_unlock(&iter);
+ BUG_ON(!ret);
+ bcache_io_error(c, bio, "btree IO error %i", ret);
out:
continue_at(cl, cached_dev_read_done_bh, NULL);
}