On 2023/3/9 17:31, Christoph Hellwig wrote:
On Thu, Mar 09, 2023 at 08:08:34AM +0800, Qu Wenruo wrote:
My current one is a new btrfs_submit_scrub_read() helper, getting rid of
features I don't need and slightly modify the endio functions to avoid any
checks if no bbio->inode. AKA, most of your idea.
So that would be mostly fine.
This looks mostly ok to me. I suspect in the longer run all metadata
I/O might be able to use this helper as well.
IMHO metadata would also go into the btrfs_check_read_bio().
As for now, all the info for metadata verification is already integrated
into bbio, thus in the long run, the no-check path would be the exception.
But for RAID56, the bioc has to live long enough for raid56 work to finish,
thus has to go btrfs_raid56_end_io() and rely on the extra bbio->end_io().
The bioc lifetimes for RAID56 are a bit odd and one of the things I'd
love to eventually look into, but іt's not very high on the priority list
right now.
If you have some good ideas, I'm very happy to try.
My current idea is to dump a bioc for btrfs_raid_bio, so
btrfs_submit_bio() path can just free the bioc after usage, no need to wait.
But not sure if this change would really cleanup the code, thus it would
still be very low on priority.
Thanks,
Qu