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

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 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 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 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 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 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 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-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-rdma: handle nvme completion data length

2020-10-23 Thread Chao Leng
Looks good. Reviewed-by: Chao Leng On 2020/10/23 14:59, zhenwei pi wrote: Hit a kernel warning: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 0 at lib/refcount.c:28 RIP: 0010:refcount_warn_saturate+0xd9/0xe0 Call Trace: nvme_rdma_recv_done+0xf3/0x280 [nvme_rdma

Re: [External] Re: [PATCH] nvme-rdma: handle nvme completion data length

2020-10-22 Thread Chao Leng
On 2020/10/22 18:05, zhenwei pi wrote: On 10/22/20 5:55 PM, Chao Leng wrote: On 2020/10/22 16:38, zhenwei pi wrote: Hit a kernel warning: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 0 at lib/refcount.c:28 RIP: 0010:refcount_warn_saturate+0xd9/0xe0 Call Trace

Re: [PATCH] nvme-rdma: handle nvme completion data length

2020-10-22 Thread Chao Leng
On 2020/10/22 16:38, zhenwei pi wrote: Hit a kernel warning: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 0 at lib/refcount.c:28 RIP: 0010:refcount_warn_saturate+0xd9/0xe0 Call Trace: nvme_rdma_recv_done+0xf3/0x280 [nvme_rdma] __ib_process_cq+0x76/0x150 [ib_core] ...