diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-04-02 19:23:26 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-04-02 19:23:26 -0800 |
commit | f5e0f87845d31ae3d9c5d1e5cda2c142b8c0fb3b (patch) | |
tree | d3e03378563ba29d45175fbd35f0bbc45615bd52 | |
parent | d37e2bb6dca5e4decf6b5918737c719fa6f17cc6 (diff) |
bcachefs: fix an error path
-rw-r--r-- | fs/bcachefs/btree_io.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/io.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index 728cbcd9f220..bb8cee15d51f 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -1187,7 +1187,7 @@ void bch2_btree_node_read(struct bch_fs *c, struct btree *b) pick = bch2_btree_pick_ptr(c, b); if (bch2_fs_fatal_err_on(!pick.ca, c, - "no cache device for btree node")) { + "btree node read error: no device to read from")) { set_btree_node_read_error(b); return; } diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index da06845cd1a7..d34946110e7d 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -93,10 +93,12 @@ static void bch2_submit_wbio(struct bch_fs *c, struct bch_write_bio *wbio, wbio->bio.bi_iter.bi_sector = ptr->offset; wbio->bio.bi_bdev = ca ? ca->disk_sb.bdev : NULL; - if (!ca) + if (unlikely(!ca)) { bcache_io_error(c, &wbio->bio, "device has been removed"); - else + bio_endio(&wbio->bio); + } else { generic_make_request(&wbio->bio); + } } void bch2_submit_wbio_replicas(struct bch_write_bio *wbio, struct bch_fs *c, |