]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: fix memory fragmentation problem reading data from client. 21098/head
authorMarcus Watts <mwatts@redhat.com>
Mon, 5 Mar 2018 21:10:29 +0000 (16:10 -0500)
committerNathan Cutler <ncutler@suse.com>
Fri, 6 Apr 2018 14:49:58 +0000 (16:49 +0200)
commit82e57cfb69f80b3f0c114e51fb88d5fed70e1f4b
tree3b0cc2f8d20a20efbb715ac250fd5d475adc68e0
parentfaec847624e26650f1fb9fcc9237b2c5b8bc406f
rgw: fix memory fragmentation problem reading data from client.

mg_read returns 0 on EOF.  In some versions of civetweb, mg_read can
return "short" reads.  The logic in the rest of ceph depends on a read
always filling its buffer when possible.  So loop here and fill the
buffer.  Looping to fill the buffer means we must also track when
mg_read returns EOF, because after that further calls to mg_read will return -1.

Fixes: https://tracker.ceph.com/issues/23207
Signed-off-by: Marcus Watts <mwatts@redhat.com>
(cherry picked from commit d9a150b1f1f9ec3952555186722c9b13d7448e2d)

Conflicts:
    src/rgw/rgw_civetweb.cc:
        - master RGWCivetWeb::RGWCivetWeb() becomes RGWMongoose::RGWMongoose() in jewel,
          with slightly different initializer list; adapt mg_read() call for jewel
        - master RGWCivetWeb::read_data() becomes RGWMongoose::read_data() in jewel,
          and inside this function we return -EIO in jewel, instead of throwing an exception
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb.h