[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <540D72BB.2020100@acm.org>
Date: Mon, 08 Sep 2014 11:11:23 +0200
From: Bart Van Assche <bvanassche@....org>
To: dgilbert@...erlog.com, Christoph Hellwig <hch@...radead.org>
CC: SCSI development list <linux-scsi@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
James Bottomley <james.bottomley@...senpartnership.com>,
Milan Broz <gmazyland@...il.com>
Subject: Re: [PATCH] scsi_debug: deadlock between completions and surprise
module removal
On 09/06/14 16:40, Douglas Gilbert wrote:
> On 14-09-05 11:25 AM, Bart Van Assche wrote:
>> An LLD must call scsi_remove_host() directly or indirectly from the
>> module
>> cleanup path. scsi_remove_host() triggers a call to
>> blk_cleanup_queue(). That
>> last function sets the flag QUEUE_FLAG_DYING which prevents that new
>> I/O is
>> queued and waits until previously queued requests have finished before
>> returning.
>
> And they do call scsi_remove_host(). But they do that toward
> the end of their clean-up. The problem that I observed has
> already happened before that.
>
> IOW I think the QUEUE_FLAG_DYING state needs to be set and
> acknowledged as the first order of business by the code
> that implements 'rmmod LLD'.
Hello Doug,
In the scsi_debug driver scsi_remove_host() is called from inside the
sdebug_driver_remove() callback function. Unless I have missed something
it is not guaranteed that that callback function is invoked before
unloading of the scsi_debug driver has finished. I think most of the
code in sdebug_driver_remove() should be moved to sdebug_remove_adapter().
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists