Martin, On 2/21/17 11:35, Martin K. Petersen wrote: >>>>>> "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. Initially, I didn't want to change more than I did so that the patch quickly make it to 4.10 and we get ZBC working with LSI HBAs. Since this did not happen and we have more time ahead, I can respin everything into sd_completed_bytes to clean things up. I will resend a patch. Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation Damien.LeMoal@xxxxxxx (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.wdc.com, www.hgst.com