From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrQJ-00052h-JS for qemu-devel@nongnu.org; Tue, 24 May 2011 09:13:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOrQI-0003gw-IO for qemu-devel@nongnu.org; Tue, 24 May 2011 09:13:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrQI-0003gp-B5 for qemu-devel@nongnu.org; Tue, 24 May 2011 09:13:22 -0400 Message-ID: <4DDBAEE9.6040301@redhat.com> Date: Tue, 24 May 2011 15:13:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> <1305630067-2119-14-git-send-email-pbonzini@redhat.com> <20110520160422.GM4466@lst.de> <4DD6A839.1020104@redhat.com> <4DDBAD07.6070904@redhat.com> In-Reply-To: <4DDBAD07.6070904@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 13/21] scsi: do not call send_command directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Christoph Hellwig , qemu-devel@nongnu.org On 05/24/2011 03:05 PM, Kevin Wolf wrote: > Maybe the callback should be done from a BH then? It sounds like this > could cause more bugs than what you're fixing here. Not sure, after all it makes sense to answer some queries synchronously (e.g. TEST_UNIT_READY). It's just the convoluted control flow that tricked you when you moved accesses to after the request has been completed. With reference counting, the data in the SCSIRequest remains completely valid after it has been completed and until the last ref goes away, so I see no reason to complicate the logic further by introducing a BH. Paolo