Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755325AbYB0Aqc (ORCPT ); Tue, 26 Feb 2008 19:46:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753298AbYB0AqV (ORCPT ); Tue, 26 Feb 2008 19:46:21 -0500 Received: from srv5.dvmed.net ([207.36.208.214]:46756 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbYB0AqU (ORCPT ); Tue, 26 Feb 2008 19:46:20 -0500 Message-ID: <47C4B2D4.109@garzik.org> Date: Tue, 26 Feb 2008 19:46:12 -0500 From: Jeff Garzik User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Andrew Morton CC: Mike Galbraith , Jens Axboe , LKML , Tejun Heo , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: regression: CD burning (k3b) went broke References: <1203583379.6244.27.camel@homer.simson.net> <20080222073228.GZ23197@kernel.dk> <1203752563.5225.4.camel@homer.simson.net> <1203839683.17463.9.camel@homer.simson.net> <1204019283.8731.11.camel@homer.simson.net> <1204033003.11828.22.camel@homer.simson.net> <20080226150845.2196bc1a.akpm@linux-foundation.org> In-Reply-To: <20080226150845.2196bc1a.akpm@linux-foundation.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.4 (----) X-Spam-Report: SpamAssassin version 3.2.3 on srv5.dvmed.net summary: Content analysis details: (-4.4 points, 5.0 required) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1827 Lines: 53 Andrew Morton wrote: > On Tue, 26 Feb 2008 14:36:43 +0100 Mike Galbraith wrote: > >> On Tue, 2008-02-26 at 10:48 +0100, Mike Galbraith wrote: >>> Greetings, >>> >>> I straced both a good and a bad kernel (good being .git with attached >>> revert patch applied) and filtered/diffed/merged the output. Scroll >>> down to "HERE" to see the problem (resid). >>> >>> I'm poking around, but not having much luck. > > cc's added. > > I'm told this is part of "Tejun's DMA drain handling". Correct. >> Seems the problem is data_len changes, but raw_data_len doesn't. I've >> not the foggiest IO-land clue, but k3b works again, so the below may >> have some diagnostic value. > > So this change fixes a bug? Can we have a recap of how it does this? > >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index ba21d97..7a6f784 100644 >> --- a/drivers/scsi/scsi_lib.c >> +++ b/drivers/scsi/scsi_lib.c >> @@ -871,7 +871,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) >> scsi_end_bidi_request(cmd); >> return; >> } >> - req->data_len = scsi_get_resid(cmd); >> + req->data_len = req->raw_data_len = scsi_get_resid(cmd); >> } I would love to get an answer as to what data_len (and of course raw_data_len) should be set to AFTER the command completes, which is what is going on here. I can see the above being correct -- scsi_get_resid() returns the length of the left-over data after the command is processed -- but I am mainly curious why setting [raw_]data_len matters after I/O completion. Jeff -- 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/