Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-02-01 Thread Chao Leng
On 2021/2/1 18:45, Hannes Reinecke wrote: On 2/1/21 10:40 AM, Chao Leng wrote: On 2021/2/1 16:57, Hannes Reinecke wrote: On 2/1/21 9:47 AM, Chao Leng wrote: On 2021/2/1 15:29, Hannes Reinecke wrote:[ .. ] Urgh. Please, no. That is well impossible to debug. Can you please open-code it

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-02-01 Thread Hannes Reinecke
On 2/1/21 10:40 AM, Chao Leng wrote: On 2021/2/1 16:57, Hannes Reinecke wrote: On 2/1/21 9:47 AM, Chao Leng wrote: On 2021/2/1 15:29, Hannes Reinecke wrote:[ .. ] Urgh. Please, no. That is well impossible to debug. Can you please open-code it to demonstrate where the difference to the

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-02-01 Thread Chao Leng
On 2021/2/1 16:57, Hannes Reinecke wrote: On 2/1/21 9:47 AM, Chao Leng wrote: On 2021/2/1 15:29, Hannes Reinecke wrote:[ .. ] Urgh. Please, no. That is well impossible to debug. Can you please open-code it to demonstrate where the difference to the current (and my fixed) versions is? I'm

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-02-01 Thread Hannes Reinecke
On 2/1/21 9:47 AM, Chao Leng wrote: On 2021/2/1 15:29, Hannes Reinecke wrote:[ .. ] Urgh. Please, no. That is well impossible to debug. Can you please open-code it to demonstrate where the difference to the current (and my fixed) versions is? I'm still not clear where the problem is once we

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-02-01 Thread Chao Leng
On 2021/2/1 15:29, Hannes Reinecke wrote: On 2/1/21 3:16 AM, Chao Leng wrote: On 2021/1/29 17:20, Hannes Reinecke wrote: On 1/29/21 9:46 AM, Chao Leng wrote: On 2021/1/29 16:33, Hannes Reinecke wrote: On 1/29/21 8:45 AM, Chao Leng wrote: On 2021/1/29 15:06, Hannes Reinecke wrote:

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-31 Thread Hannes Reinecke
On 2/1/21 3:16 AM, Chao Leng wrote: On 2021/1/29 17:20, Hannes Reinecke wrote: On 1/29/21 9:46 AM, Chao Leng wrote: On 2021/1/29 16:33, Hannes Reinecke wrote: On 1/29/21 8:45 AM, Chao Leng wrote: On 2021/1/29 15:06, Hannes Reinecke wrote: On 1/29/21 4:07 AM, Chao Leng wrote: On

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-31 Thread Chao Leng
On 2021/1/29 17:20, Hannes Reinecke wrote: On 1/29/21 9:46 AM, Chao Leng wrote: On 2021/1/29 16:33, Hannes Reinecke wrote: On 1/29/21 8:45 AM, Chao Leng wrote: On 2021/1/29 15:06, Hannes Reinecke wrote: On 1/29/21 4:07 AM, Chao Leng wrote: On 2021/1/29 9:42, Sagi Grimberg wrote:

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Hannes Reinecke
On 1/29/21 4:07 AM, Chao Leng wrote: On 2021/1/29 9:42, Sagi Grimberg wrote: You can't see exactly where it dies but I followed the assembly to nvme_round_robin_path(). Maybe it's not the initial nvme_next_ns(head, old) which returns NULL but nvme_next_ns() is returning NULL eventually

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Chao Leng
On 2021/1/29 11:30, Sagi Grimberg wrote: You can't see exactly where it dies but I followed the assembly to nvme_round_robin_path(). Maybe it's not the initial nvme_next_ns(head, old) which returns NULL but nvme_next_ns() is returning NULL eventually (list_next_or_null_rcu()). So there is

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Sagi Grimberg
You can't see exactly where it dies but I followed the assembly to nvme_round_robin_path(). Maybe it's not the initial nvme_next_ns(head, old) which returns NULL but nvme_next_ns() is returning NULL eventually (list_next_or_null_rcu()). So there is other bug cause nvme_next_ns abormal. I

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Chao Leng
On 2021/1/29 9:42, Sagi Grimberg wrote: You can't see exactly where it dies but I followed the assembly to nvme_round_robin_path(). Maybe it's not the initial nvme_next_ns(head, old) which returns NULL but nvme_next_ns() is returning NULL eventually (list_next_or_null_rcu()). So there is

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Sagi Grimberg
You can't see exactly where it dies but I followed the assembly to nvme_round_robin_path(). Maybe it's not the initial nvme_next_ns(head, old) which returns NULL but nvme_next_ns() is returning NULL eventually (list_next_or_null_rcu()). So there is other bug cause nvme_next_ns abormal. I

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Chao Leng
On 2021/1/28 17:40, Daniel Wagner wrote: On Thu, Jan 28, 2021 at 05:18:56PM +0800, Chao Leng wrote: It is impossible to return NULL for nvme_next_ns(head, old). block nvme0n1: no usable path - requeuing I/O block nvme0n1: no usable path - requeuing I/O block nvme0n1: no usable path -

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Chao Leng
On 2021/1/28 17:23, Hannes Reinecke wrote: On 1/28/21 10:18 AM, Chao Leng wrote: On 2021/1/28 15:58, Daniel Wagner wrote: On Thu, Jan 28, 2021 at 09:31:30AM +0800, Chao Leng wrote: --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -221,7 +221,7 @@ static struct

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Daniel Wagner
On Thu, Jan 28, 2021 at 05:18:56PM +0800, Chao Leng wrote: > It is impossible to return NULL for nvme_next_ns(head, old). block nvme0n1: no usable path - requeuing I/O block nvme0n1: no usable path - requeuing I/O block nvme0n1: no usable path - requeuing I/O block nvme0n1: no usable path -

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Hannes Reinecke
On 1/28/21 10:18 AM, Chao Leng wrote: On 2021/1/28 15:58, Daniel Wagner wrote: On Thu, Jan 28, 2021 at 09:31:30AM +0800, Chao Leng wrote: --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -221,7 +221,7 @@ static struct nvme_ns *nvme_round_robin_path(struct

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Chao Leng
On 2021/1/28 15:58, Daniel Wagner wrote: On Thu, Jan 28, 2021 at 09:31:30AM +0800, Chao Leng wrote: --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -221,7 +221,7 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head, } for (ns =

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-28 Thread Daniel Wagner
On Thu, Jan 28, 2021 at 09:31:30AM +0800, Chao Leng wrote: > > --- a/drivers/nvme/host/multipath.c > > +++ b/drivers/nvme/host/multipath.c > > @@ -221,7 +221,7 @@ static struct nvme_ns *nvme_round_robin_path(struct > > nvme_ns_head *head, > > } > > for (ns = nvme_next_ns(head, old); > > -

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Chao Leng
On 2021/1/27 18:30, Daniel Wagner wrote: nvme_round_robin_path() should test if the return ns pointer is valid. nvme_next_ns() will return a NULL pointer if there is no path left. Fixes: 75c10e732724 ("nvme-multipath: round-robin I/O policy") Cc: Hannes Reinecke Signed-off-by: Daniel Wagner

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Chao Leng
On 2021/1/27 18:30, Daniel Wagner wrote: nvme_round_robin_path() should test if the return ns pointer is valid. nvme_next_ns() will return a NULL pointer if there is no path left. Fixes: 75c10e732724 ("nvme-multipath: round-robin I/O policy") Cc: Hannes Reinecke Signed-off-by: Daniel Wagner

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Christoph Hellwig
Thanks, applied to nvme-5.11.

Re: [PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Hannes Reinecke
On 1/27/21 11:30 AM, Daniel Wagner wrote: nvme_round_robin_path() should test if the return ns pointer is valid. nvme_next_ns() will return a NULL pointer if there is no path left. Fixes: 75c10e732724 ("nvme-multipath: round-robin I/O policy") Cc: Hannes Reinecke Signed-off-by: Daniel Wagner

[PATCH v2] nvme-multipath: Early exit if no path is available

2021-01-27 Thread Daniel Wagner
nvme_round_robin_path() should test if the return ns pointer is valid. nvme_next_ns() will return a NULL pointer if there is no path left. Fixes: 75c10e732724 ("nvme-multipath: round-robin I/O policy") Cc: Hannes Reinecke Signed-off-by: Daniel Wagner --- v2: - moved NULL test into the if