>>>>> "Damien" == Damien Le Moal <damien.lemoal@xxxxxxx> writes: Hi Damien, Damien> Move the partial completion alignement check of mpt3sas to a Damien> generic implementation in sd_done so that the check ignores Damien> REQ_TYPE_FS requests with special payload size handling Damien> (REQ_OP_DISCARD, REQ_OP_WRITE_SAME, REQ_OP_ZONE_REPORT and Damien> REQ_OP_ZONE_RESET). For the remaining REQ_OP_FLUSH, REQ_OP_READ Damien> and REQ_OP_WRITE, we only need to check the resid alignment, Damien> correct it if necessary and then correct good_bytes. Note that Damien> in this case, good_bytes will always initially be 0 or aligned Damien> on the device logical block size, so correcting resid alignment Damien> will always result in good_bytes also being properly aligned. I'm still not keen on having two orthogonal sanity checks wrt. figuring out how much of a request has been completed. Also, I find your approach hard to follow in the case where sd_completed_bytes() is called after the resid has been adjusted. It works, but it's not immediately obvious that that's the case. Which to me is an indication that this entire thing needs a thorough cleanup. If you don't feel like mucking more with this, I understand. In that case might pick up your patch and attempt to clean things up later. -- Martin K. Petersen Oracle Linux Engineering