From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH] SCSI IOCTL: Check for device deletion [was Re: __elv_add_request OOPS] Date: Wed, 25 May 2011 21:02:24 +0200 Message-ID: <4DDD5240.2060308@fusionio.com> References: <4DDB8BF6.2000304@fusionio.com> <4DDCB1C8.7040708@fusionio.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.fusionio.com ([66.114.96.30]:58115 "EHLO mx1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496Ab1EYTC2 (ORCPT ); Wed, 25 May 2011 15:02:28 -0400 In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Linus Torvalds Cc: Parag Warudkar , "linux-kernel@vger.kernel.org" , "James.Bottomley@hansenpartnership.com" , "akpm@linux-foundation.org" , Linux SCSI List On 2011-05-25 20:55, Linus Torvalds wrote: > On Wed, May 25, 2011 at 11:44 AM, Parag Warudkar wrote: >> >> Below patch pushes the check down to ioctl functions and hopefully should >> cover more ioctl-on-gone-device cases by returning -ENXIO if an attempt >> was made to submit request to a non-running device. > > Can we please not duplicate complicated logic like that? > > IOW, just make a helper function for it. > > That said, isn't this all *exactly* what scsi_prep_state_check() is > supposed to check for? Why isn't that called, or if called, why isn't > it doing the right thing? This is before you get that far, it's actually oopsing on inserting the request on sdev->sdev_queue that is now NULL. The prep state checking happens when sr/sd pulls the request off the queue for processing. -- Jens Axboe