[openib-general] Re: [PATCH] sdp_post_rdma_iocb_snk check iocb
Michael S. Tsirkin
mst at mellanox.co.il
Wed Jun 15 13:01:19 PDT 2005
Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: [PATCH] sdp_post_rdma_iocb_snk check iocb
>
> On Wed, Jun 15, 2005 at 12:44:08PM +0300, Michael S. Tsirkin wrote:
> > In sdp_post_rdma_iocb_snk, if sdp_iocb_q_get_head returns NULL, iocb is then
> > used without checking.
>
> Michael,
>
> This is done in a number of places, and the check for NULL iocb should
> not be necessary. Earlier in each function where it's done, we perform a
> look at the head of the queue and only continue if there is an iocb at
> the head of the queue:
>
> iocb = sdp_iocb_q_look(&conn->r_pend);
>
> The reason I did it this way is to avoid having to return the iocb back
> into the same queue if it is not entirely consumed or on a recoverable
> error, depending on the function.
>
> -Libor
Okay, but the test if (result < 0) is clearly bogus since result
isnt set?
> > Index: sdp_recv.c
> > ===================================================================
> > --- sdp_recv.c (revision 2608)
> > +++ sdp_recv.c (working copy)
> > @@ -411,7 +411,7 @@ static int sdp_post_rdma_iocb_snk(struct
> > * queue IOCB
> > */
> > iocb = sdp_iocb_q_get_head(&conn->r_pend);
> > - if (result < 0) {
> > + if (!iocb) {
> > sdp_dbg_warn(conn, "read IOCB missing from pending table <%d>",
> > sdp_iocb_q_size(&conn->r_pend));
> > goto release;
> >
> > --
> > MST
>
--
MST
More information about the general
mailing list