[pnfs] [PATCH 2/2] bc_send: handle error from bc_alloc_task

William A. (Andy) Adamson andros at citi.umich.edu
Fri May 25 12:52:04 EDT 2007


This patch did not apply to the 4.1-sessions branch. There is no
xprt_free_bc_request(req); after the out: label.

here is the function in the 4.1-sessions branch.

/*
 * Send the callback reply
 */
int bc_send(struct rpc_rqst *req)
{
        struct rpc_task *bc_task;
        int err;
        struct xdr_buf *xbufp = &req->rq_snd_buf;
        struct rpc_xprt *xprt = req->rq_xprt;

        /*
         * Create an rpc_task to send the data
         */
        bc_task = bc_alloc_task(req);

        /*
         * Reserve the xprt and then try to send the request across
         */
        err = bc_reserve_xprt(bc_task);
        if (err)
                goto out;

        /*
         * Set up the xdr_buf length
         */
        xbufp->len = xbufp->head[0].iov_len + xbufp->page_len +
xbufp->tail[0].iov_len;

        err = xprt->ops->send_request(bc_task);

        bc_release_xprt(bc_task);

        xprt_free_bc_request(req);
        return 0;
out:
        bc_task->tk_rqstp = NULL;
        bc_release_task(bc_task);
        return err;
}

Why do you return zero and not the err from xprt->ops->send_request?

Here is what I suggest:




More information about the pNFS mailing list