[Gluster-devel] [puzzle] readv operation allocate iobuf twice

Zhengping Zhou johnzzpcrystal at gmail.com
Tue Jul 12 03:58:01 UTC 2016


Hi all:

    It is a puzzle to me that we  allocate rsp buffers for rspond
content in function client3_3_readv, but these rsp parameters hasn't
ever been saved to struct saved_frame in submit procedure. Which means
the iobuf will reallocated by transport layer in function
__socket_read_accepted_successful_reply.
    According to  the commnet of fucntion rpc_clnt_submit :
    1. Both @rsp_hdr and @rsp_payload are optional.
    2. The user of rpc_clnt_submit, if wants response hdr and payload in its own
        buffers, then it has to populate @rsphdr and @rsp_payload.
        ....
    The rsp_payload  is optional, ransport layer will not reallocate
rsp buffers if
it populated. But the fact is readv operation will allocate rsp buffer twice.

Thanks
Zhengping


More information about the Gluster-devel mailing list