On Fri, Mar 02, 2018 at 10:58:10AM +0100, Maxime Chevallier wrote: > I think that the right way to compute that value would be the minimum > between the desc_len and the remaining part that would fit in the page : > min(desc_len, min(len, (PAGE_SIZE - offset_in_page(buf))) > But again, I also could miss something here, hence why I bring that > topic on this list :) Yes, I think that's about right. The only thing I can think might be a problem is if things don't divide neatly and we end up making very short descriptors (eg, if the max_seg_len is PAGE_SIZE - 1 so we end up with a 1 byte descriptor) I'm not sure how likely or worth worrying about that is. Possibly worth leaving as the above and then letting anyone who runs into trouble solve it. Can you send a patch please?
Attachment:
signature.asc
Description: PGP signature