bcachefs: Don't reuse bio in retry path
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 24 Oct 2019 18:22:29 +0000 (14:22 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:30 +0000 (17:08 -0400)
We can't reuse bios without reinitializing them, and in the retry path
it's safer to just make sure we don't reuse them at all.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io.c

index a343393115d8c3f4eaa49a6c533dbd30b3fbacfc..3f075dcfafb2699790385eea0ee75dadd869843c 100644 (file)
@@ -1447,6 +1447,7 @@ static void bch2_read_retry_nodecode(struct bch_fs *c, struct bch_read_bio *rbio
        int ret;
 
        flags &= ~BCH_READ_LAST_FRAGMENT;
+       flags |= BCH_READ_MUST_CLONE;
 
        bch2_trans_init(&trans, c, 0, 0);