rbio->c wasn't being initialized in the move path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
return rbio;
}
+/*
+ * Only called on a top level bch_read_bio to complete an entire read request,
+ * not a split:
+ */
static void bch2_rbio_done(struct bch_read_bio *rbio)
{
- bch2_time_stats_update(&rbio->c->times[BCH_TIME_data_read],
- rbio->start_time);
+ if (rbio->start_time)
+ bch2_time_stats_update(&rbio->c->times[BCH_TIME_data_read],
+ rbio->start_time);
bio_endio(&rbio->bio);
}
GFP_KERNEL))
goto err_free;
- io->rbio.opts = io_opts;
+ io->rbio.c = c;
+ io->rbio.opts = io_opts;
bio_init(&io->rbio.bio, NULL, io->bi_inline_vecs, pages, 0);
io->rbio.bio.bi_vcnt = pages;
bio_set_prio(&io->rbio.bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));