Skip to content

Commit 2774b2c

Browse files
author
Jan Schmidt
committed
btrfs: Put mirror_num in bi_bdev
The error correction code wants to make sure that only the bad mirror is rewritten. Thus, we need to know which mirror is the bad one. I did not find a more apropriate field than bi_bdev. But I think using this is fine, because it is modified by the block layer, anyway, and should not be read after the bio returned. Signed-off-by: Jan Schmidt <[email protected]>
1 parent 1503140 commit 2774b2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,8 @@ static void btrfs_end_bio(struct bio *bio, int err)
32163216
}
32173217
bio->bi_private = bbio->private;
32183218
bio->bi_end_io = bbio->end_io;
3219+
bio->bi_bdev = (struct block_device *)
3220+
(unsigned long)bbio->mirror_num;
32193221
/* only send an error to the higher layers if it is
32203222
* beyond the tolerance of the multi-bio
32213223
*/

0 commit comments

Comments
 (0)