The 0 sized segment can arise depending on how
the client uploads the object in the first place.
The cpu loop then happens during a swift `GET'.
Signed-off-by: Marcus Watts <mwatts@redhat.com>
(cherry picked from commit
46c5f9773246522e66bb2cca49345d0b62a16c42)
return -EPERM;
}
+ if (ent.size == 0) {
+ return 0;
+ }
+
perfcounter->inc(l_rgw_get_b, cur_end - cur_ofs);
while (cur_ofs <= cur_end) {
bufferlist bl;
off_t len = bl.length();
cur_ofs += len;
+ if (!len) {
+ ldout(s->cct, 0) << "ERROR: read 0 bytes; ofs=" << cur_ofs
+ << " end=" << cur_end << " from obj=" << ent.key.name
+ << "[" << ent.key.instance << "]" << dendl;
+ return -EIO;
+ }
op_ret = 0; /* XXX redundant? */
perfcounter->tinc(l_rgw_get_lat,
(ceph_clock_now(s->cct) - start_time));
return r;
}
+ if (!total_len) {
+ bufferlist bl;
+ send_response_data(bl, 0, 0);
+ }
+
return 0;
}