summaryrefslogtreecommitdiff
path: root/libbcachefs/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/io.c')
-rw-r--r--libbcachefs/io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbcachefs/io.c b/libbcachefs/io.c
index da06845c..d3494611 100644
--- a/libbcachefs/io.c
+++ b/libbcachefs/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,