Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399Ab1E1Mm2 (ORCPT ); Sat, 28 May 2011 08:42:28 -0400 Received: from mx1.fusionio.com ([66.114.96.30]:53553 "EHLO mx1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327Ab1E1Mm0 (ORCPT ); Sat, 28 May 2011 08:42:26 -0400 X-ASG-Debug-ID: 1306586545-03d6a512a8188a0001-xx1T2L X-Barracuda-Envelope-From: JAxboe@fusionio.com Message-ID: <4DE0EDAD.5060108@fusionio.com> Date: Sat, 28 May 2011 14:42:21 +0200 From: Jens Axboe MIME-Version: 1.0 To: James Bottomley CC: Parag Warudkar , Linus Torvalds , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , Linux SCSI List Subject: Re: [PATCH] SCSI IOCTL: Check for device deletion [was Re: __elv_add_request OOPS] References: <4DDB8BF6.2000304@fusionio.com> <4DDCB1C8.7040708@fusionio.com> <4DDD5240.2060308@fusionio.com> <4DDD55D6.1080909@fusionio.com> <1306356735.1641.61.camel@mulgrave.site> <1306468385.4048.73.camel@mulgrave.site> <4DDF3A07.7040106@fusionio.com> <1306527677.12244.2.camel@mulgrave.site> X-ASG-Orig-Subj: Re: [PATCH] SCSI IOCTL: Check for device deletion [was Re: __elv_add_request OOPS] In-Reply-To: <1306527677.12244.2.camel@mulgrave.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1306586545 X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.64909 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2235 Lines: 64 On 2011-05-27 22:21, James Bottomley wrote: > On Fri, 2011-05-27 at 07:43 +0200, Jens Axboe wrote: >> On 2011-05-27 05:53, James Bottomley wrote: >>> On Wed, 2011-05-25 at 15:52 -0500, James Bottomley wrote: >>>> On Wed, 2011-05-25 at 16:42 -0400, Parag Warudkar wrote: >>>>> Yeah - that makes sense. By that logic, looks like we can only disallow >>>>> for SDEV_DEL (if we decide to do that check here). >>>> >>>> I don't think this is the root cause. I think q is non-NULL but has >>>> already been released, so we're just getting a NULL deref on the actual >>>> list head. >>>> >>>> Does this fix it? It adds the refcounting at approximately the correct >>>> places. Of course, we'll now be trying elevator operations on an extant >>>> queue but one whose elevator functions have been destroyed, so there are >>>> probably additional state guards to place. >>>> >>>> James >>>> >>>> --- >>>> >>>> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c >>>> index 58584dc..44e8ca3 100644 >>>> --- a/drivers/scsi/scsi_scan.c >>>> +++ b/drivers/scsi/scsi_scan.c >>>> @@ -297,7 +297,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, >>>> kfree(sdev); >>>> goto out; >>>> } >>>> - >>>> + blk_get_queue(sdev->request_queue); >>> >>> Apparently we can't do this because blk_[put|get]_queue aren't exported >>> for use in modules (and SCSI can be modular), so this caused a build >>> failure in linux-next. >> >> I'll just export them. > > OK, if you're fine with that, how does this patch look? Outdated :-) I already merged the export addition: commit d86e0e83b32bc84600adb0b6ea1fce389b266682 Author: Jens Axboe Date: Fri May 27 07:44:43 2011 +0200 block: export blk_{get,put}_queue() > I can take it through my rc-fixes tree (with your ack), since I'm a bit > late on the merge window now. Only the SCSI bit remains, so add at will. You can add my acked-by to that standalone, if you wish. -- Jens Axboe -- 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/