diff mbox

[v2] Avoid possible hang on device removal

Message ID 1477438557-15884-1-git-send-email-mustafa.ismail@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Ismail, Mustafa Oct. 25, 2016, 11:35 p.m. UTC
When we get an RDMA_CM_EVENT_DEVICE_REMOVAL the cm_thread will
exit and because flush errors are ignored the cb->sem may not get signaled.
So just signal on device removal event.

v1 -> v2: Add Fixes tag 

Fixes: 612eae1f6fe3 ("rping: ignore flushed completions")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
---
 librdmacm/examples/rping.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Leon Romanovsky Oct. 27, 2016, 7:29 a.m. UTC | #1
On Tue, Oct 25, 2016 at 06:35:57PM -0500, Mustafa Ismail wrote:
> When we get an RDMA_CM_EVENT_DEVICE_REMOVAL the cm_thread will
> exit and because flush errors are ignored the cb->sem may not get signaled.
> So just signal on device removal event.
>
> v1 -> v2: Add Fixes tag
>
> Fixes: 612eae1f6fe3 ("rping: ignore flushed completions")
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
> ---
>  librdmacm/examples/rping.c | 2 ++
>  1 file changed, 2 insertions(+)

Mustafa,

For future submissions, please use rdma-core notation in [PATCH ..]
section, so we will be able to handle them faster.

Thanks
Leon Romanovsky Oct. 27, 2016, 1:56 p.m. UTC | #2
On Tue, Oct 25, 2016 at 06:35:57PM -0500, Mustafa Ismail wrote:
> When we get an RDMA_CM_EVENT_DEVICE_REMOVAL the cm_thread will
> exit and because flush errors are ignored the cb->sem may not get signaled.
> So just signal on device removal event.
>
> v1 -> v2: Add Fixes tag
>
> Fixes: 612eae1f6fe3 ("rping: ignore flushed completions")
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>

Thanks applied,
I changed a little bit commit message, please take a look on it.
https://github.com/linux-rdma/rdma-core/pull/28

> ---
>  librdmacm/examples/rping.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
> index ad38f6d..53c1525 100644
> --- a/librdmacm/examples/rping.c
> +++ b/librdmacm/examples/rping.c
> @@ -224,6 +224,8 @@ static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
>
>  	case RDMA_CM_EVENT_DEVICE_REMOVAL:
>  		fprintf(stderr, "cma detected device removal!!!!\n");
> +		cb->state = ERROR;
> +		sem_post(&cb->sem);
>  		ret = -1;
>  		break;
>
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
index ad38f6d..53c1525 100644
--- a/librdmacm/examples/rping.c
+++ b/librdmacm/examples/rping.c
@@ -224,6 +224,8 @@  static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
 
 	case RDMA_CM_EVENT_DEVICE_REMOVAL:
 		fprintf(stderr, "cma detected device removal!!!!\n");
+		cb->state = ERROR;
+		sem_post(&cb->sem);
 		ret = -1;
 		break;