* [PATCH] librdmacm: Set errno correctly if status is positive
@ 2018-01-10 16:07 Yuval Shaia
[not found] ` <20180110160721.14469-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yuval Shaia @ 2018-01-10 16:07 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Yuval Shaia
No need to convert to positive if status is already positive.
Fixes: 1ef5c3a84 ("librdmacm: Set errno correctly in ucma_complete")
Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
librdmacm/cma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 25ebaaee..fb2dc5e4 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -866,7 +866,7 @@ int ucma_complete(struct rdma_cm_id *id)
else if (id_priv->id.event->status < 0)
ret = ERR(-id_priv->id.event->status);
else
- ret = ERR(-id_priv->id.event->status);
+ ret = ERR(id_priv->id.event->status);
}
return ret;
}
--
2.14.3
--
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] 4+ messages in thread
* Re: [PATCH] librdmacm: Set errno correctly if status is positive
[not found] ` <20180110160721.14469-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2018-01-10 18:29 ` Jason Gunthorpe
[not found] ` <20180110182932.GJ4518-uk2M96/98Pc@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2018-01-10 18:29 UTC (permalink / raw)
To: Yuval Shaia
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Wed, Jan 10, 2018 at 06:07:21PM +0200, Yuval Shaia wrote:
> No need to convert to positive if status is already positive.
>
> Fixes: 1ef5c3a84 ("librdmacm: Set errno correctly in ucma_complete")
>
> Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> librdmacm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index 25ebaaee..fb2dc5e4 100644
> +++ b/librdmacm/cma.c
> @@ -866,7 +866,7 @@ int ucma_complete(struct rdma_cm_id *id)
> else if (id_priv->id.event->status < 0)
> ret = ERR(-id_priv->id.event->status);
> else
> - ret = ERR(-id_priv->id.event->status);
> + ret = ERR(id_priv->id.event->status);
This code hurts my brain - why is status sometimes a possitive errno
and sometimes a negative errno?
Jason
--
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] 4+ messages in thread
* Re: [PATCH] librdmacm: Set errno correctly if status is positive
[not found] ` <20180110182932.GJ4518-uk2M96/98Pc@public.gmane.org>
@ 2018-01-10 18:33 ` Yuval Shaia
2018-01-23 17:02 ` Doug Ledford
0 siblings, 1 reply; 4+ messages in thread
From: Yuval Shaia @ 2018-01-10 18:33 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, leon-DgEjT+Ai2ygdnm+yROfE0A,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Wed, Jan 10, 2018 at 11:29:32AM -0700, Jason Gunthorpe wrote:
> On Wed, Jan 10, 2018 at 06:07:21PM +0200, Yuval Shaia wrote:
> > No need to convert to positive if status is already positive.
> >
> > Fixes: 1ef5c3a84 ("librdmacm: Set errno correctly in ucma_complete")
> >
> > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> > librdmacm/cma.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> > index 25ebaaee..fb2dc5e4 100644
> > +++ b/librdmacm/cma.c
> > @@ -866,7 +866,7 @@ int ucma_complete(struct rdma_cm_id *id)
> > else if (id_priv->id.event->status < 0)
> > ret = ERR(-id_priv->id.event->status);
> > else
> > - ret = ERR(-id_priv->id.event->status);
> > + ret = ERR(id_priv->id.event->status);
>
> This code hurts my brain - why is status sometimes a possitive errno
> and sometimes a negative errno?
Have no idea :)
But since current code ask "if (id_priv->id.event->status < 0)" i assume it
can.
>
> Jason
--
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] 4+ messages in thread
* Re: [PATCH] librdmacm: Set errno correctly if status is positive
2018-01-10 18:33 ` Yuval Shaia
@ 2018-01-23 17:02 ` Doug Ledford
0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2018-01-23 17:02 UTC (permalink / raw)
To: Yuval Shaia, Jason Gunthorpe
Cc: leon-DgEjT+Ai2ygdnm+yROfE0A, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Wed, 2018-01-10 at 20:33 +0200, Yuval Shaia wrote:
> On Wed, Jan 10, 2018 at 11:29:32AM -0700, Jason Gunthorpe wrote:
> > On Wed, Jan 10, 2018 at 06:07:21PM +0200, Yuval Shaia wrote:
> > > No need to convert to positive if status is already positive.
> > >
> > > Fixes: 1ef5c3a84 ("librdmacm: Set errno correctly in ucma_complete")
> > >
> > > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> > > librdmacm/cma.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> > > index 25ebaaee..fb2dc5e4 100644
> > > +++ b/librdmacm/cma.c
> > > @@ -866,7 +866,7 @@ int ucma_complete(struct rdma_cm_id *id)
> > > else if (id_priv->id.event->status < 0)
> > > ret = ERR(-id_priv->id.event->status);
> > > else
> > > - ret = ERR(-id_priv->id.event->status);
> > > + ret = ERR(id_priv->id.event->status);
> >
> > This code hurts my brain - why is status sometimes a possitive errno
> > and sometimes a negative errno?
>
> Have no idea :)
> But since current code ask "if (id_priv->id.event->status < 0)" i assume it
> can.
Since this item covers the entire gamut of events, I wouldn't be
surprised if there are some events defined with negative returns and
some with positive returns. Anyway, an audit of all the returns is more
than I want to do just for this patch (and I did a quick look through in
the kernel to see if the answer to this is easy to get to and
unfortunately it's not because of how many places you need to track down
the treatment of the status item), so I'll apply it as is.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-23 17:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 16:07 [PATCH] librdmacm: Set errno correctly if status is positive Yuval Shaia
[not found] ` <20180110160721.14469-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2018-01-10 18:29 ` Jason Gunthorpe
[not found] ` <20180110182932.GJ4518-uk2M96/98Pc@public.gmane.org>
2018-01-10 18:33 ` Yuval Shaia
2018-01-23 17:02 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox