> 2025年7月17日 12:52,Christoph Hellwig <hch@xxxxxx> 写道: > > On Thu, Jul 17, 2025 at 12:29:27AM +0800, Yu Kuai wrote: >>> If opt_io_size is (chunk_size * data_disks), setting new max_hw_sectors as rounddown(current max_hw_sectors, opt_io_size) is good idea. >> >> I think round down max_hw_sectors to io_opt(chunk_size * data_disks) will >> really >> make things much easier, perhaps Christoph means this way. All you need to >> do is to >> handle not aligned bio and split that part, and for aligned bio fall back >> to use >> bio_split_to_limits(). > > If the raid5 code can handle multiple stripes per I/O, than you > just need to round it down, yes. I assumed it could only handle > a single full or partial stripe at a time, but I guess I was wrong. > > Thanks for the suggestion. I will compose a new version. Coly Li