From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42460 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrCUB-0005Fk-Gy for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:18:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrCU8-0000s4-0H for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:17:57 -0400 Received: from demumfd002.nsn-inter.net ([93.183.12.31]:13122) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrCU7-0000rS-KX for qemu-devel@nongnu.org; Thu, 02 Sep 2010 12:17:55 -0400 Message-ID: <4C7FCE30.5030704@nsn.com> Date: Thu, 02 Sep 2010 18:17:52 +0200 From: Bernhard Kohl MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] scsi-generic: don't report negative length to the SCSI adapter References: <1283434052-11866-1-git-send-email-bernhard.kohl@nsn.com> <4C7FB574.7090906@redhat.com> In-Reply-To: <4C7FB574.7090906@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ext Kevin Wolf Cc: qemu-devel@nongnu.org Am 02.09.2010 16:32, schrieb ext Kevin Wolf: > Can we add a comment why len can become< 0 and that this is a > workaround for buggy drivers? It's in your commit message, but I prefer > this kind of things to be explained in the code. > Yes I will do that, if we decide to apply this patch (see below). > Also, are we sure that broken drivers always return negative numbers > when their result is wrong, or can we still get incorrect results? Obviously there are currently no additional problems with wrong 'resid' values. I found the problem with an older IET version (1.4.18) which was the last one available from rpmfusion (kmod-iscsitarget, iscsitarget, built for kernel 2.6.31.12). After that I switched to STGT which is part of Fedora (scsi-target-utils). I don't know how the current IET (1.4.20.2) behaves. If the 'resid' is not reported correctly, there is no way to calculate the correct received data length without analyzing the content of the SCSI data. Negative length only occurred if the allocation length in the MODE SENSE command was to small. But negative length confuses the adapter driver. I propose to skip this patch as long as there are no news about IET. Sorry for the confusion. The patch was still in my queue since March. Bernhard