The return-value-type of RGWRados::Object::Read::read is int, and
the return value of RGWRados::Object::Read::read is either the
length of object data which has been read if everything is OK,
or the error value which is negative value if something is wrong.
If an negative error value is assigned to read_len which is an
unsigned long long type, the read_len will be a very large value,
which will cause an error during RGWPutObjProcessor processing.
Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
do {
bufferlist bl;
ret = read_op.read(ofs, end, bl);
+ if (ret < 0) {
+ ldout(cct, 0) << "ERROR: fail to read object data, ret = " << ret << dendl;
+ return ret;
+ }
uint64_t read_len = ret;
bool again;