Hi,
在 2025/05/13 14:44, Christoph Hellwig 写道:
On Mon, May 12, 2025 at 03:56:23PM -0700, Bart Van Assche wrote:
The block layer submits bio fragments in opposite LBA order. Fix this as
follows:
I don't understand this as well, for example, if bio is 8k and it splits
at 4k: bio: 0->4k, split_bio 4k->8k. And then split_bio is added to
current->bio_list while the old bio is submitted first.
Thanks,
Kuai
- Introduce a new function bio_split_to_limits_and_submit() that has the
same behavior as the existing bio_split_to_limits() function. This
involves splitting a bio and submitting the fragment with the highest
LBA by calling submit_bio_noacct().
- Use the new function bio_split_to_limits_and_submit() in all drivers
that are fine with submitting split bios in opposite LBA order.
If you have to rename a user visible symbol, please do that in a
preparation patch.
Also how do you determine some drivers are fine with one order while
others are not?
- Modify blk_mq_submit_bio() and dm_split_and_process_bio() such that
bio fragments are submitted in LBA order.
blk_mq_submit_bio calls __bio_split_to_limits, which returns the
bio split off the beginning of the passed in bio by bio_submit_split.
I don't see how that would reorder anything.
.