Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-05 Thread Sagi Grimberg
Rakesh, I would post a new patch which includes my RESETTING state earlier patch + the cancel_work_sync which Sagi suggested after testing. Sagi: Because my RESETTING patch earlier is subset of your untested patch with cancel_work_sync, it would be logical to take a signed off from you as well.

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-05 Thread Rakesh Pandit
On Mon, Jun 05, 2017 at 10:18:17AM +0200, Christoph Hellwig wrote: > On Sun, Jun 04, 2017 at 06:28:15PM +0300, Sagi Grimberg wrote: > > > >> I think we need the NVME_CTRL_SCHED_RESET state. In fact I'm pretty > >> sure some time in the past I already had it in a local tree as a > >> generalization

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-05 Thread Christoph Hellwig
On Sun, Jun 04, 2017 at 06:28:15PM +0300, Sagi Grimberg wrote: > >> I think we need the NVME_CTRL_SCHED_RESET state. In fact I'm pretty >> sure some time in the past I already had it in a local tree as a >> generalization of rdma and loop already use NVME_CTRL_RESETTING >> (they set it before queu

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-04 Thread Sagi Grimberg
I think we need the NVME_CTRL_SCHED_RESET state. In fact I'm pretty sure some time in the past I already had it in a local tree as a generalization of rdma and loop already use NVME_CTRL_RESETTING (they set it before queueing the reset work). I don't remember having it, but I might be wrong..

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Ming Lei
On Thu, Jun 01, 2017 at 10:33:04PM +0300, Rakesh Pandit wrote: > On Thu, Jun 01, 2017 at 10:56:10PM +0800, Ming Lei wrote: > > On Thu, Jun 01, 2017 at 02:46:32PM +0200, Christoph Hellwig wrote: > > > On Thu, Jun 01, 2017 at 03:36:50PM +0300, Rakesh Pandit wrote: > > > > Also Sagi pointed out that u

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Rakesh Pandit
On Thu, Jun 01, 2017 at 10:56:10PM +0800, Ming Lei wrote: > On Thu, Jun 01, 2017 at 02:46:32PM +0200, Christoph Hellwig wrote: > > On Thu, Jun 01, 2017 at 03:36:50PM +0300, Rakesh Pandit wrote: > > > Also Sagi pointed out that user space set_features ioctl if fired up > > > in a window after nvme_r

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Ming Lei
On Thu, Jun 01, 2017 at 02:46:32PM +0200, Christoph Hellwig wrote: > On Thu, Jun 01, 2017 at 03:36:50PM +0300, Rakesh Pandit wrote: > > Also Sagi pointed out that user space set_features ioctl if fired up > > in a window after nvme_removal it can also result in this issue seems > > to be correct.

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Christoph Hellwig
On Thu, Jun 01, 2017 at 03:36:50PM +0300, Rakesh Pandit wrote: > Also Sagi pointed out that user space set_features ioctl if fired up > in a window after nvme_removal it can also result in this issue seems > to be correct. I would prefer to keep this as it is and introduce > similar check higher u

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Rakesh Pandit
On Thu, Jun 01, 2017 at 03:28:18PM +0300, Rakesh Pandit wrote: > On Thu, Jun 01, 2017 at 01:43:38PM +0200, Christoph Hellwig wrote: > > On Tue, May 30, 2017 at 05:23:46PM +0300, Rakesh Pandit wrote: > > > We can fix user-space triggered set_features higger up e.g. in > > > nvme_ioctl by putting sam

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Christoph Hellwig
On Thu, Jun 01, 2017 at 03:28:18PM +0300, Rakesh Pandit wrote: > > I think we need the NVME_CTRL_SCHED_RESET state. In fact I'm pretty > > sure some time in the past I already had it in a local tree as a > > generalization of rdma and loop already use NVME_CTRL_RESETTING > > (they set it before qu

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Rakesh Pandit
On Thu, Jun 01, 2017 at 01:43:38PM +0200, Christoph Hellwig wrote: > On Tue, May 30, 2017 at 05:23:46PM +0300, Rakesh Pandit wrote: > > We can fix user-space triggered set_features higger up e.g. in > > nvme_ioctl by putting same check. Introduction of a separate state > > NVME_CTRL_SCHED_RESET (b

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-06-01 Thread Christoph Hellwig
On Tue, May 30, 2017 at 05:23:46PM +0300, Rakesh Pandit wrote: > We can fix user-space triggered set_features higger up e.g. in > nvme_ioctl by putting same check. Introduction of a separate state > NVME_CTRL_SCHED_RESET (being discussed in another thread) has > additional advantage of making sure

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-05-30 Thread Rakesh Pandit
On Tue, May 30, 2017 at 01:18:55PM +0300, Sagi Grimberg wrote: > > > /* > > +* Avoid configuration and syncing commands if controller is already > > +* being removed and queues have been killed. > > +*/ > > + if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD)

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-05-30 Thread Sagi Grimberg
/* +* Avoid configuration and syncing commands if controller is already +* being removed and queues have been killed. +*/ + if (ctrl->state == NVME_CTRL_DELETING || ctrl->state == NVME_CTRL_DEAD) + return; + Hey Rakesh, Christoph, Given that

Re: [PATCH V2] nvme: fix nvme_remove going to uninterruptible sleep for ever

2017-05-30 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig