* bug in ucma_accept()?
@ 2013-01-07 19:13 Steve Wise
[not found] ` <50EB1E49.7020807-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Steve Wise @ 2013-01-07 19:13 UTC (permalink / raw)
To: Hefty, Sean; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hey Sean,
Is this a bug? I think it is...
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 2709ff5..fb24f05 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -806,8 +806,13 @@ static ssize_t ucma_accept(struct ucma_file *file,
const ch
if (!ret)
ctx->uid = cmd.uid;
mutex_unlock(&file->mut);
- } else
+ } else {
+ mutex_lock(&file->mut);
ret = rdma_accept(ctx->cm_id, NULL);
+ if (!ret)
+ ctx->uid = cmd.uid;
+ mutex_unlock(&file->mut);
+ }
ucma_put_ctx(ctx);
return ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <50EB1E49.7020807-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>]
* RE: bug in ucma_accept()? [not found] ` <50EB1E49.7020807-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org> @ 2013-01-07 19:22 ` Hefty, Sean [not found] ` <1828884A29C6694DAF28B7E6B8A8237346AEE645-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Hefty, Sean @ 2013-01-07 19:22 UTC (permalink / raw) To: Steve Wise; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Is this a bug? I think it is... > > diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c > index 2709ff5..fb24f05 100644 > --- a/drivers/infiniband/core/ucma.c > +++ b/drivers/infiniband/core/ucma.c > @@ -806,8 +806,13 @@ static ssize_t ucma_accept(struct ucma_file *file, > const ch > if (!ret) > ctx->uid = cmd.uid; > mutex_unlock(&file->mut); > - } else > + } else { > + mutex_lock(&file->mut); > ret = rdma_accept(ctx->cm_id, NULL); > + if (!ret) > + ctx->uid = cmd.uid; > + mutex_unlock(&file->mut); > + } The ctx->uid has already been set in the else case when the user explicitly created the cm_id. We only need to set it when the ctx has been created in the kernel for the user in response to a connection request (the 'if' part to the above else). - Sean -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <1828884A29C6694DAF28B7E6B8A8237346AEE645-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: bug in ucma_accept()? [not found] ` <1828884A29C6694DAF28B7E6B8A8237346AEE645-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2013-01-07 19:30 ` Steve Wise 0 siblings, 0 replies; 3+ messages in thread From: Steve Wise @ 2013-01-07 19:30 UTC (permalink / raw) To: Hefty, Sean; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 1/7/2013 1:22 PM, Hefty, Sean wrote: > >> Is this a bug? I think it is... >> >> diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c >> index 2709ff5..fb24f05 100644 >> --- a/drivers/infiniband/core/ucma.c >> +++ b/drivers/infiniband/core/ucma.c >> @@ -806,8 +806,13 @@ static ssize_t ucma_accept(struct ucma_file *file, >> const ch >> if (!ret) >> ctx->uid = cmd.uid; >> mutex_unlock(&file->mut); >> - } else >> + } else { >> + mutex_lock(&file->mut); >> ret = rdma_accept(ctx->cm_id, NULL); >> + if (!ret) >> + ctx->uid = cmd.uid; >> + mutex_unlock(&file->mut); >> + } > The ctx->uid has already been set in the else case when the user explicitly created the cm_id. We only need to set it when the ctx has been created in the kernel for the user in response to a connection request (the 'if' part to the above else). > > Ah. Thanks for clarifying... -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-07 19:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 19:13 bug in ucma_accept()? Steve Wise
[not found] ` <50EB1E49.7020807-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-01-07 19:22 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A8237346AEE645-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-01-07 19:30 ` Steve Wise
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).