[Lustre-devel] Query to understand the Lustre request/reply message

Alexey Lyashkov alexey.lyashkov at clusterstor.com
Wed Oct 13 20:38:16 PDT 2010


On Oct 14, 2010, at 03:28, Nicolas Williams wrote:

> On Wed, Oct 13, 2010 at 07:51:37PM -0400, Vilobh Meshram wrote:
>> 1) Is it possible that without writing a new RPC in Lustre 1.8.1.1 I can
>> append some string such as "Hello" to the exsisting message sent by the
>> Client (with the buffer size set at client side by the count,size fields).I
>> tried modifying the "size" of the request for one of the RPC in-built in
>> Lustre
> 
> Yes, it's possible to add buffers to requests.  It's not possible to add
> buffers to _replies_ to existing RPCs unless you know the client expects
> those additional buffers -- existing clients expect a given maxsize for
> each reply, and if your reply is bigger then it will get dropped.
It is wrong for last ~1year.
~1year ago i add code to ptlrpc layer which a adjust buffer for reply, and resend a request.

        if (ev->mlength < ev->rlength ) {
                CDEBUG(D_RPCTRACE, "truncate req %p rpc %d - %d+%d\n", req,
                       req->rq_replen, ev->rlength, ev->offset);
                req->rq_reply_truncate = 1;
                req->rq_replied = 1;
                req->rq_status = -EOVERFLOW;
                req->rq_nob_received = ev->rlength + ev->offset;

...

        if (req->rq_reply_truncate) {
                if (ptlrpc_no_resend(req)) {
                        DEBUG_REQ(D_ERROR, req, "reply buffer overflow,"
                                  " expected: %d, actual size: %d",
                                  req->rq_nob_received, req->rq_repbuf_len);
                        RETURN(-EOVERFLOW);
                }

                sptlrpc_cli_free_repbuf(req);
                /* Pass the required reply buffer size (include
                 * space for early reply).
                 * NB: no need to roundup because alloc_repbuf
                 * will roundup it */
                req->rq_replen       = req->rq_nob_received;
                req->rq_nob_received = 0;
                req->rq_resend       = 1;
                RETURN(0);
        }


--------------------------------------
Alexey Lyashkov
alexey.lyashkov at clusterstor.com







More information about the lustre-devel mailing list