Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-25 Thread Christoph Hellwig
On Mon, Sep 25, 2017 at 10:23:16AM +0200, Hannes Reinecke wrote: > > We could have such an interface I assume. But it would suck to maintain > > yet another state (we are already having enough trouble to have a > > coherent controller state machine). > > Weell ... we could be using a notifier chai

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-25 Thread Hannes Reinecke
On 09/25/2017 09:09 AM, Sagi Grimberg wrote: > > > On 25/09/17 08:59, Hannes Reinecke wrote: >> On 09/25/2017 07:37 AM, Sagi Grimberg wrote: >>> So why exposing it then in the first time? I know you don't want dm-mpath in NVMe (neither do I) but we have to have something until your

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-25 Thread Sagi Grimberg
On 25/09/17 08:59, Hannes Reinecke wrote: On 09/25/2017 07:37 AM, Sagi Grimberg wrote: So why exposing it then in the first time? I know you don't want dm-mpath in NVMe (neither do I) but we have to have something until your patchset and ANA is merged. And with this patch it's trivial to bui

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-24 Thread Hannes Reinecke
On 09/25/2017 07:37 AM, Sagi Grimberg wrote: > >> So why exposing it then in the first time? I know you don't want >> dm-mpath in >> NVMe (neither do I) but we have to have something until your patchset >> and ANA >> is merged. And with this patch it's trivial to build a path checker >> that just

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-24 Thread Sagi Grimberg
So why exposing it then in the first time? I know you don't want dm-mpath in NVMe (neither do I) but we have to have something until your patchset and ANA is merged. And with this patch it's trivial to build a path checker that just looks at the state attribute in sysfs. Can't we just not use

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-24 Thread Sagi Grimberg
Notify sysfs about changes of a nvme controller so user-space can watch the file via poll() or select() in order to react to a state change. Userspace has no business polling for the state. Please consider this patch. At least upstream multipath-tools is using the sysfs state now: [1] htt

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-21 Thread Christoph Hellwig
On Thu, Sep 21, 2017 at 07:19:15AM +0200, Johannes Thumshirn wrote: > So why exposing it then in the first time? It is a really nice debug aid, but the states really are an internal detail of the implementation, and can (and probably will soon, see the fc states discussion) change. Maybe we need

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-21 Thread Guan Junxiong
On 2017/9/20 22:59, Christoph Hellwig wrote: > On Wed, Sep 20, 2017 at 12:40:32PM +0200, Johannes Thumshirn wrote: >> Notify sysfs about changes of a nvme controller so user-space can watch the >> file via poll() or select() in order to react to a state change. > > Userspace has no business poll

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-20 Thread Johannes Thumshirn
On Wed, Sep 20, 2017 at 04:59:31PM +0200, Christoph Hellwig wrote: > On Wed, Sep 20, 2017 at 12:40:32PM +0200, Johannes Thumshirn wrote: > > Notify sysfs about changes of a nvme controller so user-space can watch the > > file via poll() or select() in order to react to a state change. > > Userspac

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-20 Thread Christoph Hellwig
On Wed, Sep 20, 2017 at 12:40:32PM +0200, Johannes Thumshirn wrote: > Notify sysfs about changes of a nvme controller so user-space can watch the > file via poll() or select() in order to react to a state change. Userspace has no business polling for the state.

Re: [PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-20 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg

[PATCH] nvme: make controller 'state' sysfs attribute pollable

2017-09-20 Thread Johannes Thumshirn
Notify sysfs about changes of a nvme controller so user-space can watch the file via poll() or select() in order to react to a state change. Signed-off-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/cor