lkml.org 
[lkml]   [2008]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: fix residual byte count handling
FUJITA Tomonori wrote:
>> At the end of blk_rq_map_user() together with data_len / extra_len
>> mangling or were you talking about James' original patch?
>
> With my patch, at the end of blk_rq_map_user, we have:
>
> if (len & queue_dma_alignment(q)) {
> unsigned int pad_len = (queue_dma_alignment(q) & ~len) + 1;
>
> rq->extra_len += pad_len;
> }
>
>
> So no change as compared with 2.6.24?

Oh.. you killed sg list manipulation. Many controllers do allow odd
bytes as the last sg entry but not all. Also, if you append drain
buffer after it, it ends up with unaligned sg entry in the middle and
rq->data_len + rq->extra_len will overrun the sg entry after the drain
page which is really dangerous.

--
tejun


\
 
 \ /
  Last update: 2008-03-03 15:25    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site