On Thu, May 23, 2024 at 10:12:24AM -0400, Mike Snitzer wrote: > Not sure what is sketchy about the max_sectors == 0 check, the large > comment block explains that check quite well. We want to avoid EIO > for unsupported operations (otherwise we'll get spurious path failures > in the context of dm-multipath). Could be we can remove this check > after an audit of how LLD handle servicing IO for unsupported > operations -- so best to work through it during a devel cycle. Think of what happens if you create a dm device, and then reduce max_sectors using sysfs on the lower device after the dm device was created: you'll trivially trigger this check. > Not sure why scsi_debug based testing with mptest isn't triggering it > for you. Are you seeing these limits for the underlying scsi_debug > devices? > > ./max_hw_sectors_kb:2147483647 > ./max_sectors_kb:512 root@testvm:~/mptest# cat /sys/block/sdc/queue/max_hw_sectors_kb 2147483647 root@testvm:~/mptest# cat /sys/block/sdd/queue/max_sectors_kb 512 root@testvm:~/mptest# cat /sys/block/dm-0/queue/max_hw_sectors_kb 2147483647 root@testvm:~/mptest# cat /sys/block/dm-0/queue/max_sectors_kb 1280 so they don't match, but for some reason bigger bios never get built.