From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49288 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdOca-0000wY-7W for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:57:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdOcZ-00011P-44 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:57:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdOcY-00011K-TR for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:57:51 -0500 Message-ID: <4D2F1341.7000403@redhat.com> Date: Thu, 13 Jan 2011 15:59:13 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] scsi-generic: bugfixes for 'SCSIRequest' conversion References: <1290586723-8724-1-git-send-email-nab@linux-iscsi.org> <4CECD36E.50401@suse.de> <4CECD50F.9060501@redhat.com> <4CECE609.7080600@suse.de> <1290595993.2509.8.camel@haakon2.linux-iscsi.org> <1292896196.16694.652.camel@pasglop> <1293141514.4649.144.camel@haakon2.linux-iscsi.org> In-Reply-To: <1293141514.4649.144.camel@haakon2.linux-iscsi.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: qemu-devel , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , linux-iscsi-target-dev@googlegroups.com, Hannes Reinecke Am 23.12.2010 22:58, schrieb Nicholas A. Bellinger: > On Tue, 2010-12-21 at 12:49 +1100, Benjamin Herrenschmidt wrote: >>> Yep, so it appears that commit 89c0f6438d16 did introduce the bogus >>> 'double complete' in scsi_read_complete, which I think was intended to >>> handle residual counts for TYPE_TYPE... >>> >>> /* Cancel a pending data transfer. */ >>> @@ -251,6 +257,8 @@ static void scsi_read_complete(void * opaque, int ret) >>> >>> r->len = -1; >>> s->completion(s->opaque, SCSI_REASON_DATA, r->tag, len); >>> + if (len == 0) >>> + scsi_command_complete(r, 0); >>> } >>> >>> I am currently under the assumption for this and bsg_read_complete that >>> s->completion(..., len) is handling the residual count back to block. >>> >>> Is this correct..? >> >> So I just debugged a crash where loading my vscsi driver kills qemu >> (segfault) after trying to complete a command twice with scsi-generic. >> >> Removing the above hunk fixes it. So this is a genuine fix that should >> be applied (asap even :-) >> > > Hi Ben, > > Thanks for verifying this one. Kevin, please make sure this original > patch to drop the bogus double complete gets picked up. Wasn't the original patch NACKed by Hannes in parts? Can you re-post a patch that includes only this specific fix? Kevin