lkml.org 
[lkml]   [2016]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion
From
Date

> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index 6dd43f6..de80f56 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -619,7 +619,7 @@
> mutex_unlock(&isert_np->mutex);
>
> isert_info("np %p: Allow accept_np to continue\n", isert_np);
> - up(&isert_np->sem);
> + complete(&isert_np->comp);
> }
>
> static void
> @@ -2311,7 +2311,7 @@ struct rdma_cm_id *
> isert_err("Unable to allocate struct isert_np\n");
> return -ENOMEM;
> }
> - sema_init(&isert_np->sem, 0);
> + init_completion(&isert_np->comp);

This is still racy, a connect event can complete just before we
init the completion and *will* get lost...

This code started off with a waitqueue which exposes the same
problem, see:
531b7bf4bd79 Target/iser: Fix iscsit_accept_np and rdma_cm racy flow

So, still NAK from me...

\
 
 \ /
  Last update: 2016-11-21 08:37    [W:0.182 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site