From: Yehuda Sadeh Date: Thu, 25 Oct 2018 22:32:16 +0000 (-0700) Subject: rgw: don't try to read beyong object size X-Git-Tag: v14.1.0~314^2~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c451928019e7a4fa7184833836ed30a9879dc509;p=ceph.git rgw: don't try to read beyong object size Otherwise even if we prefetch all the data, we'd try to issue another request to read the rest of the object. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 819c957c9008..9e7f82733da3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6481,6 +6481,12 @@ int RGWRados::Object::Read::read(int64_t ofs, int64_t end, bufferlist& bl) if (r < 0) return r; + if (astate->size == 0) { + end = 0; + } else if (end >= (int64_t)astate->size) { + end = astate->size - 1; + } + if (end < 0) len = 0; else