login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
5
Re: [PATCH] blk: missing add of padded bytes to io completion byte count
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jens Axboe <jens.axboe@...>
To: Boaz Harrosh <bharrosh@...>
Cc: FUJITA Tomonori <fujita.tomonori@...>, Tejun Heo <htejun@...>, Mike Galbraith <efault@...>, <James.Bottomley@...>, <tomof@...>, <akpm@...>, <linux-kernel@...>, <linux-ide@...>, <linux-scsi@...>, <jgarzik@...>, <bzolnier@...>
Subject:
Re: [PATCH] blk: missing add of padded bytes to io completion byte count
Date: Wednesday, March 5, 2008 - 8:48 am
On Wed, Mar 05 2008, Boaz Harrosh wrote:
quoted text
> On Wed, Mar 05 2008 at 14:33 +0200, Jens Axboe <jens.axboe@oracle.com> wrote: > > On Wed, Mar 05 2008, Boaz Harrosh wrote: > >> On Wed, Mar 05 2008 at 2:26 +0200, FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote: > >>> On Wed, 05 Mar 2008 08:33:05 +0900 > >>> Tejun Heo <htejun@gmail.com> wrote: > >>> > >>>> FUJITA Tomonori wrote: > >>>>> Hmm, does SCSI mid-layer need to care about how many bytes the block > >>>>> layer allocates? I don't think that extra_len is NOT good_bytes. > >>>>> > >>>>> I think that the block layer had better take care about it (fix > >>>>> __end_that_request_first?). > >>>> Yeah, probably calling completion functions w/o bytes count is the right > >>>> thing to do but what I was talking about was what could break when the > >>>> semantics of rq->data_len changed. If we keep rq->data_len() == > >>>> sum(sg), we keep it business as usual for all the rest except for the > >>>> device application layer if we don't we do the reverse and SCSI midlayer > >>>> completion was a good example, I think. > >>> sglist is a low-level I/O representation for device drivers. SCSI > >>> midlayer should not care about sglist. We should not fix SCSI midlayer > >>> for rq->data_len != sum(sg) change (so I can't agree with your > >>> diagrams in another mail). > >>> > >>> When if we change a rule, we need to fix something. > >>> > >>> If we keep rq->data_len == sum(sg), we need to fix the device > >>> application layer. If we keep rq->data_len == the true data length, we > >>> need to fix the low-level drivers. > >>> > >>> Now I'm fine with the commit e97a294ef6938512b655b1abf17656cf2b26f709 > >>> since we are in -rc stages. But I plan to send a patch to revert it > >>> and fix this issue in the block layer. I'd like to test it in -mm for > >>> a while. > >> No this commit is a serious bug, and the only fix is like you suggested > >> in __end_that_request_first. This is because it breaks that scsi-ml loop > >> where scsi_bufflen() can be less then blk_rq_bytes(). In that case this > >> commit is a data corruption. > >> > >>> Only sglist stuff in SCSI midlayer is scsi_req_map_sg now. As you > >>> know, we really want to remove it. > >>> > >>> > >>>> Things going the other way is fine with me but I at least want to hear a > >>>> valid rationale. Till now all I got is "because that's the true size" > >>>> which doesn't really make much sense to me. > >>> Most of users of request structure care about only the real data > >>> length, don't care about padding and drain length. Why do they bother > >>> to use a helper function to get the real data length? > >>> -- > >> Submitted is the right fix to this problem, as pointed out by TOMO. > >> Please test it solves the CD burning problem. > >> (The patch includes the revert of commit e97a294e) > >> --- > >> From: Boaz Harrosh <bharrosh@panasas.com> > >> Date: Wed, 5 Mar 2008 12:07:12 +0200 > >> Subject: [PATCH] blk: missing add of padded bytes to io completion byte count > >> > >> the commit e97a294ef6938512b655b1abf17656cf2b26f709 was very wrong. This is > >> because scsi-ml supports the ability to split a request into smaller chunks, > >> in which case scsi_bufflen() is smaller then request length. Then at completion > >> time the remainder can be issued as a new scsi command. In that case the above > >> commit is a data corruption. > > > > We needed something for -rc4, so it had to be rushed a bit... > > > >> Also in this fix all users of block layer are taken care of, and not only > >> scsi devices. > >> > >> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> > >> Signed-off-by: Benny Halevy <bhalevy@panasas.com> > >> --- > >> block/blk-core.c | 4 ++++ > >> drivers/scsi/scsi.c | 2 +- > >> 2 files changed, 5 insertions(+), 1 deletions(-) > >> > >> diff --git a/block/blk-core.c b/block/blk-core.c > >> index 2a438a9..37fcccc 100644 > >> --- a/block/blk-core.c > >> +++ b/block/blk-core.c > >> @@ -1549,6 +1549,9 @@ static int __end_that_request_first(struct request *req, int error, > >> nr_bytes >> 9, req->sector); > >> } > >> > >> + if (nr_bytes >= blk_rq_bytes(req)) > >> + nr_bytes += req->extra_len; > >> + > >> total_bytes = bio_nbytes = 0; > >> while ((bio = req->bio) != NULL) { > >> int nbytes; > >> @@ -1616,6 +1619,7 @@ static int __end_that_request_first(struct request *req, int error, > >> if (!req->bio) > >> return 0; > >> > >> + BUG_ON(total_bytes >= blk_rq_bytes(req)); > > > > Make that a WARN_ON() first please. It's indeed a bug, but it wont be > > critical and it's not fair killing everything since this padding stuff > > is so fresh and may still need a tweak or two. > > > > I'd be fine with making it a BUG_ON() post 2.6.25. > > > Updated, you are absolutely right, thanks. > > Will you commit below patch for 2.6.25? I know that, at the time, I have > seen this scsi-ml-loop in action on a sata drive here in the lab, on an > x86_64 machine. The current solution will silently corrupt data, which > is very hard to find.
Yes, was just hoping you'd resend with the above corrected, so thanks! I'll add it to the pending queue for 2.6.25. -- Jens Axboe --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
regression: CD burning (k3b) went broke
, Mike Galbraith
, (Thu Feb 21, 4:42 am)
Re: regression: CD burning (k3b) went broke
, Jens Axboe
, (Fri Feb 22, 3:32 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Sat Feb 23, 3:42 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Sun Feb 24, 3:54 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Tue Feb 26, 5:48 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Tue Feb 26, 9:36 am)
Re: regression: CD burning (k3b) went broke
, Andrew Morton
, (Tue Feb 26, 7:08 pm)
Re: regression: CD burning (k3b) went broke
, Jeff Garzik
, (Tue Feb 26, 8:46 pm)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Tue Feb 26, 10:58 pm)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Tue Feb 26, 10:24 pm)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Wed Feb 27, 2:00 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Wed Feb 27, 3:07 am)
Re: regression: CD burning (k3b) went broke
, Tejun Heo
, (Thu Feb 28, 3:43 am)
Re: regression: CD burning (k3b) went broke
, Mike Galbraith
, (Thu Feb 28, 4:20 am)
[PATCH] block: fix residual byte count handling
, Tejun Heo
, (Thu Feb 28, 4:50 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Thu Feb 28, 11:35 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Thu Feb 28, 11:46 am)
Re: [PATCH] block: fix residual byte count handling
, James Bottomley
, (Fri Feb 29, 12:47 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Fri Feb 29, 4:11 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Sat Mar 1, 2:17 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Sun Mar 2, 10:52 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Sun Mar 2, 10:40 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Sun Mar 2, 11:59 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 12:09 am)
[PATCH 1/2] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 2:08 am)
[PATCH] block: separate out padding from alignment
, Tejun Heo
, (Mon Mar 3, 2:10 am)
Re: [PATCH] block: separate out padding from alignment
, James Bottomley
, (Mon Mar 3, 2:27 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 4:26 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 5:21 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 8:17 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 9:38 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 9:50 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 9:55 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 10:01 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 10:22 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 10:52 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 6:44 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Mon Mar 3, 10:11 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Mon Mar 3, 10:32 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 4:53 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 4:59 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 5:29 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 5:06 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 5:22 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 5:30 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 5:35 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 5:40 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 5:46 am)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 8:37 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 8:40 am)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 9:30 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 9:50 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 12:17 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 12:42 pm)
Re: [PATCH] block: fix residual byte count handling
, Boaz Harrosh
, (Tue Mar 4, 2:26 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 2:35 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 3:19 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 7:33 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 7:54 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Tue Mar 4, 8:26 pm)
[PATCH] blk: missing add of padded bytes to io completion by...
, Boaz Harrosh
, (Wed Mar 5, 6:16 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, FUJITA Tomonori
, (Thu Mar 6, 1:02 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Jens Axboe
, (Wed Mar 5, 8:33 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Boaz Harrosh
, (Wed Mar 5, 8:46 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Jens Axboe
, (Wed Mar 5, 8:48 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Tejun Heo
, (Wed Mar 5, 9:45 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Boaz Harrosh
, (Wed Mar 5, 10:46 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Tejun Heo
, (Wed Mar 5, 11:11 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Jens Axboe
, (Wed Mar 5, 9:51 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, James Bottomley
, (Wed Mar 5, 11:21 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, FUJITA Tomonori
, (Thu Mar 6, 12:41 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Jens Axboe
, (Thu Mar 6, 9:41 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, FUJITA Tomonori
, (Thu Mar 20, 8:54 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Tejun Heo
, (Thu Mar 6, 8:07 pm)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, FUJITA Tomonori
, (Fri Mar 7, 11:07 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Tejun Heo
, (Fri Mar 7, 9:06 pm)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Tejun Heo
, (Wed Mar 5, 10:08 am)
Re: [PATCH] blk: missing add of padded bytes to io completio...
, Mike Galbraith
, (Wed Mar 5, 8:28 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 8:44 pm)
Re: [PATCH] block: fix residual byte count handling
, FUJITA Tomonori
, (Thu Mar 6, 12:56 am)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Thu Mar 6, 1:02 am)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 2:45 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 3:25 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 3:33 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 3:34 pm)
Re: [PATCH] block: fix residual byte count handling
, James Bottomley
, (Tue Mar 4, 2:27 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 2:33 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 8:45 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 8:39 am)
Re: [PATCH] block: fix residual byte count handling
, walt
, (Tue Mar 4, 1:34 pm)
Re: [PATCH] block: fix residual byte count handling
, Tejun Heo
, (Tue Mar 4, 1:59 pm)
Re: [PATCH] block: fix residual byte count handling
, Kiyoshi Ueda
, (Tue Mar 4, 3:42 pm)
Re: [PATCH] block: fix residual byte count handling
, James Bottomley
, (Tue Mar 4, 12:04 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 2:46 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 8:43 am)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 8:58 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 9:03 am)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 10:25 am)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 2:17 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 2:29 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 2:35 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 2:45 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 2:49 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 2:54 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Tue Mar 4, 3:26 pm)
Re: [PATCH] block: fix residual byte count handling
, Jens Axboe
, (Tue Mar 4, 3:28 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Christie
, (Sun Mar 2, 2:46 pm)
Re: [PATCH] block: fix residual byte count handling
, Mike Galbraith
, (Sun Mar 2, 11:27 pm)
Re: [PATCH] block: fix residual byte count handling
, James Bottomley
, (Sat Mar 1, 11:19 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 004/196] Chinese: add translation of SubmittingPatches
James Bottomley
Re: Announce: Linux-next (Or Andrew's dream :-))
David Miller
[GIT]: Networking
linux-netdev
:
Antonio Almeida
HTB accuracy for high speed
Ingo Molnar
iwlwifi: fix build bug in "iwlwifi: fix LED stall"
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Avi Kivity
Re: [RFC PATCH 14/17] kvm: add a reset capability
git
:
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
2 users
and
720 guests
online.
Online users
cbelgra009
hamidmushtaq
Syndicate