Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755204Ab2BNLyq (ORCPT ); Tue, 14 Feb 2012 06:54:46 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:60485 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858Ab2BNLyo (ORCPT ); Tue, 14 Feb 2012 06:54:44 -0500 MIME-Version: 1.0 In-Reply-To: <4F3A46DD.8030305@ce.jp.nec.com> References: <4EE8E419.8010000@pre-sense.de> <20111225215804.03ef9402@stein> <4F3A46DD.8030305@ce.jp.nec.com> Date: Tue, 14 Feb 2012 12:54:42 +0100 X-Google-Sender-Auth: _ouZV8Ds2BIRM6XoJIGWzHC35NU Message-ID: Subject: Re: Yet another hot unplug NULL pointer dereference (was Re: status of oops in sd_revalidate_disk?) From: Bart Van Assche To: "Jun'ichi Nomura" Cc: Stefan Richter , jbottomley@parallels.com, linux-scsi@vger.kernel.org, Huajun Li , Axel Theilmann , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 910 Lines: 19 On Tue, Feb 14, 2012 at 12:34 PM, Jun'ichi Nomura wrote: > While scsi_device is propery refcounted object, > q->queuedata is set to NULL by scsi_remove_device() asynchronously. > So every reader of scsi_device's q->queuedata should always check it. As far as I can see this patch narrows the race window but doesn't fix the race. At least sd_prep_fn() still reads queuedata and if I'm not mistaken that read races with scsi_remove_device(). Has it been considered to modify scsi_remove_device() and scsi_request_fn() such that device removal is communicated from the former to the latter in another way than by clearing queuedata ? Bart. -- 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/