• A
    rbd: don't leak rbd_req on synchronous requests · 2e53c6c3
    Alex Elder 提交于
    When rbd_do_request() is called it allocates and populates an
    rbd_req structure to hold information about the osd request to be
    sent.  This is done for the benefit of the callback function (in
    particular, rbd_req_cb()), which uses this in processing when
    the request completes.
    
    Synchronous requests provide no callback function, in which case
    rbd_do_request() waits for the request to complete before returning.
    This case is not handling the needed free of the rbd_req structure
    like it should, so it is getting leaked.
    
    Note however that the synchronous case has no need for the rbd_req
    structure at all.  So rather than simply freeing this structure for
    synchronous requests, just don't allocate it to begin with.
    Signed-off-by: NAlex Elder <elder@inktank.com>
    Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
    2e53c6c3
rbd.c 90.5 KB