btrfs: call btrfs_orig_bbio_end_io when btrfs_end_bio_work
PATCH 1/1 btrfs: call btrfs_orig_bbio_end_io when btrfs_end_bio_work
When I implemented the storage layer bio splitting, I was under the assumption that we'll never split metadata bios. But Qu reminded me that this can actually happen with very old file systems with unaligned metadata chunks and RAID0. I still haven't seen such a case in practice, but we better handled this case, especially as it is fairly easily to do not calling the ->end_іo method directly in btrfs_end_io_work, and using the proper btrfs_orig_bbio_end_io helper instead.
--- fs/btrfs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/bio.c +1 -1
@@ -357,7 +357,7 @@ static void btrfs_end_bio_work(struct work_struct *work)if (is_data_bbio (bbio))btrfs_check_read_bio (bbio, bbio->bio.bi_private);else - bbio->end_io (bbio); +btrfs_orig_bbio_end_io (bbio); }static void btrfs_simple_end_io (struct bio *bio)
Signature · 1 line
2.39.2
Quoted 2 lines · Johannes Thumshirn
Reviewed-by Johannes Thumshirn <[email protected]>Tested-by Johannes Thumshirn <[email protected]>
To add some context:
in addition to the old file system with unaligned metadata chunks case documented in the commit log, the combination of the new scrube code with Johannes pending raid-stripe-tree also triggers this case. We spent some time debugging it yesterday and found that this patch solves the problem.
Quoted 10 lines · Christoph Hellwig
When I implemented the storage layer bio splitting, I was under the assumption that we'll never split metadata bios. But Qu reminded me that this can actually happen with very old file systems with unaligned metadata chunks and RAID0. I still haven't seen such a case in practice, but we better handled this case, especially as it is fairly easily to do not calling the ->end_іo method directly in
btrfs_end_io_work, and using the properbtrfs_orig_bbio_end_iohelper instead.Fixes 103c19723c80 ("btrfs: split the bio submission path into a separate file")Signed-off-by Christoph Hellwig <[email protected]>
Added to misc-next, with an update to changelog with your additional explanation.
Commit 103c19723c80 is 6.2 but there are some intermediate changes so the backport won't be straightforward, for 6.3 it seems doable.