[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080228153542.GZ6704@kernel.dk>
Date: Thu, 28 Feb 2008 16:35:43 +0100
From: Jens Axboe <jens.axboe@...cle.com>
To: Tejun Heo <htejun@...il.com>
Cc: Mike Galbraith <efault@....de>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>, linux-ide@...r.kernel.org,
linux-scsi@...r.kernel.org, Jeff Garzik <jgarzik@...ox.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists