On Sat, Mar 28, 2020 at 11:13 AM Keith Busch <kbusch@xxxxxxxxxx> wrote: > > On Sat, Mar 28, 2020 at 10:11:57AM +0800, Ming Lei wrote: > > On Sat, Mar 28, 2020 at 2:18 AM Keith Busch <kbusch@xxxxxxxxxx> wrote: > > > > > > This is actually even more confusing. We do not support 256MB transfers > > > within a single command in the pci nvme driver anymore. The max is 4MB, > > > so I don't see how increasing the max segments will help: you should be > > > hitting the 'max_sectors' limit if you don't hit the segment limit first. > > > > That looks a bug for passthrough req, because 'max_sectors' limit is only > > checked in bio_add_pc_page(), not done in blk_rq_append_bio(), something > > like the following seems required: > > Shouldn't bio_map_user_iov() or bio_copy_user_iov() have caught the > length limit before proceeding to blk_rq_append_bio()? Actually the limit should be caught earlier in bio_add_pc_page(), that requires to pass 'rq' in, then one perfect passthrough bio can be made before appending to rq. Not only max sector limit, max segments & virt_boundary should be checked in request wide too. So far, only lightnvm calls bio_add_pc_page() before allocating request, and that is the 1st bio, so NULL rq can be passed. thanks, Ming Lei