From f5e0f87845d31ae3d9c5d1e5cda2c142b8c0fb3b Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 2 Apr 2017 19:23:26 -0800 Subject: bcachefs: fix an error path --- fs/bcachefs/btree_io.c | 2 +- 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, -- cgit v1.2.3