How to limit the number of blocks written or read in a Write_10 or Read command on Linux?
0
votes
0
answers
112
views
Here is the problem: My usb storage device has a 64kB (limited by hardware) buffer used to cache reads/writes which means it can only cache up to 128 blocks(512B) of memory. The SCSI Write-10 command has a total-blocks field that can be up to 256 blocks (128kB). When originally testing the product on Windows 11 it never writes more than 128 blocks at a time but when tested on Linux it sometimes writes more than 128 blocks, which causes the microcontroller to crash.
Is there a way to tell the host OS not to request more than 128 blocks?
I have implemented block limit VPD page, and it works well on Windows 10/11. I even set the block limit to be 64 blocks, it's OK! However, on Linux or MacOS, the host does not appear to be running the block limits command. So the write/read blocks number beyond the buffer size.
Asked by user26314708
(1 rep)
Jul 10, 2024, 09:44 AM