lkml.org 
[lkml]   [2008]   [Feb]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 28 Feb 2008 16:35:43 +0100
FromJens Axboe <>
SubjectRe: [PATCH] block: fix residual byte count handling
On Thu, Feb 28 2008, Tejun Heo wrote:
> rq->raw_data_len introduced for block layer padding and draining
> (commit 6b00769fe1502b4ad97bb327ef7ac971b208bfb5) broke residual byte
> count handling.  Block drivers modify rq->data_len to notify residual
> byte count to the block layer which blindly reported unmodified
> rq->raw_data_len to userland.
> 
> To keep block drivers dealing only with rq->data_len, this should be
> handled inside block layer.  However, how much extra buffer was
> appened is lost after rq->data_len is modified.
> 
> This patch replaces rq->raw_data_len with rq->extra_len and add
> blk_rq_raw_data_len() helper to calculate raw data size from
> rq->data_len and rq->extra_len.  The helper returns correct raw
> residual byte count when called on a rq whose data_len is modified to
> carry residual byte count.
> 
> This problem was reported and diagnosed by Mike Galbraith.

Tejun, this patch isn't much cleaner at all. It really shows the pain of
these two seperate, yet related, variables.

-- 
Jens Axboe



\
 
 \ /
  Last update: 2008-02-28 16:39    [from the cache]
©2003-2008