Sorry about the delay. Was buried under other stuff. Mike, thanks a
lot for reporting and analyzing the problem; however, the patch is
slightly incorrect. rq->data_len is rq->data_len + extra stuff for
alignment and padding, so the correct thing to do is...
which is ugly and error-prone. In addition, this isn't the only place
where resid is set. Other block drivers do this too. This definitely
should be done in block layer.
With rq->data_len and rq->raw_data_len, it's impossible to translate
resid of rq->data_len to resid of rq->raw_data_len as block layer
doesn't know how much was extra data after rq->data_len is modified.
The attached patch substitutes rq->raw_data_len w/ rq->extra_len and
adds blk_rq_raw_data_len(). Things look cleaner this way and the resid
problem should be solved with this.
Can you please verify the attached patch fixes the problem?