RE: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-10-03 Thread Elliott, Robert (Server Storage)
Christoph Hellwig; > Milan Broz > Subject: Re: [PATCH] scsi_debug: deadlock between completions and surprise > module removal > > Review ping again? > > While I think the shutdown code in scsi_debug needs a bit more of an > overhault I'd really like to include the fix at le

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-25 Thread Christoph Hellwig
Review ping again? While I think the shutdown code in scsi_debug needs a bit more of an overhault I'd really like to include the fix at least for 3.18 and 3.17-stable now that we have missed the 3.17 window. On Sun, Aug 31, 2014 at 07:09:59PM -0400, Douglas Gilbert wrote: > A deadlock has been re

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-09 Thread Christoph Hellwig
On Mon, Sep 08, 2014 at 04:31:01PM -0400, Douglas Gilbert wrote: > stop_all_queued() is doing hrtimer_cancel(), del_timer_sync() > or tasklet_kill() on all the scsi_cmnd objects that are > "in play". Unless another mechanism calls the .eh_abort_handler > entry point reliably on each "in play" comma

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-08 Thread Douglas Gilbert
On 14-09-08 11:07 AM, Christoph Hellwig wrote: On Mon, Sep 08, 2014 at 11:11:23AM +0200, Bart Van Assche wrote: 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 th

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-08 Thread Christoph Hellwig
On Mon, Sep 08, 2014 at 11:11:23AM +0200, Bart Van Assche wrote: > 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 u

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-08 Thread Bart Van Assche
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 preve

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-06 Thread Christoph Hellwig
On Sat, Sep 06, 2014 at 10:40:06AM -0400, Douglas Gilbert wrote: > 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

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-06 Thread Douglas Gilbert
On 14-09-05 11:25 AM, Bart Van Assche wrote: On 09/05/14 15:56, Douglas Gilbert wrote: With scsi-mq I think many LLDs probably have a new race possibility between a surprise rmmod of the LLD and another thread presenting a new command at about the same time (or another thread's command completin

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-05 Thread Bart Van Assche
On 09/05/14 15:56, Douglas Gilbert wrote: With scsi-mq I think many LLDs probably have a new race possibility between a surprise rmmod of the LLD and another thread presenting a new command at about the same time (or another thread's command completing around that time). Does anything above the L

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-05 Thread Douglas Gilbert
With scsi-mq I think many LLDs probably have a new race possibility between a surprise rmmod of the LLD and another thread presenting a new command at about the same time (or another thread's command completing around that time). Does anything above the LLD stop this happening? Looking at mpt3sas

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-04 Thread Christoph Hellwig
Can I get another review for this one? On Sun, Aug 31, 2014 at 07:09:59PM -0400, Douglas Gilbert wrote: > A deadlock has been reported when the completion > of SCSI commands (simulated by a timer) was surprised > by a module removal. This patch removes one half of > the offending locks around time

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-01 Thread Douglas Gilbert
On 14-09-01 11:36 AM, Christoph Hellwig wrote: --- a/drivers/scsi/scsi_debug.c 2014-08-26 13:24:51.646948507 -0400 +++ b/drivers/scsi/scsi_debug.c 2014-08-30 18:04:54.589226679 -0400 @@ -2743,6 +2743,13 @@ static int stop_queued_cmnd(struct scsi_ if (test_bit(k, queued_in_use_bm))

Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal

2014-09-01 Thread Christoph Hellwig
> --- a/drivers/scsi/scsi_debug.c 2014-08-26 13:24:51.646948507 -0400 > +++ b/drivers/scsi/scsi_debug.c 2014-08-30 18:04:54.589226679 -0400 > @@ -2743,6 +2743,13 @@ static int stop_queued_cmnd(struct scsi_ > if (test_bit(k, queued_in_use_bm)) { > sqcp