From: an.groshev Date: Tue, 15 Jan 2019 12:57:34 +0000 (+0300) Subject: rgw: swift: fix: https://tracker.ceph.com/issues/37765 X-Git-Tag: v13.2.7~105^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=14f982b2f01b389c69e8f1da5cc2ac454c9a6eb2;p=ceph.git rgw: swift: fix: https://tracker.ceph.com/issues/37765 The meaning is as follows: iterate_slo_parts() set end offset equal to the size of the segment, but RGWRados::iterate_obj args wait offset not size. Signed-off-by: Andrey Groshev (cherry picked from commit 9cbbd63776cfcbcd8011f77be15313ee8d9bc373) Conflicts: src/rgw/rgw_op.cc - where master has "ldpp_dout(this, X)", mimic uses "ldout(s->cct, X)" --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 5400a6247972d..73e64c82aa263 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1379,7 +1379,7 @@ static int iterate_slo_parts(CephContext *cct, ent.meta.etag = part.etag; uint64_t cur_total_len = obj_ofs; - uint64_t start_ofs = 0, end_ofs = ent.meta.size; + uint64_t start_ofs = 0, end_ofs = ent.meta.size - 1; if (!found_start && cur_total_len + ent.meta.size > (uint64_t)ofs) { start_ofs = ofs - obj_ofs; @@ -1389,7 +1389,7 @@ static int iterate_slo_parts(CephContext *cct, obj_ofs += ent.meta.size; if (!found_end && obj_ofs > (uint64_t)end) { - end_ofs = end - cur_total_len + 1; + end_ofs = end - cur_total_len; found_end = true; } @@ -1398,6 +1398,12 @@ static int iterate_slo_parts(CephContext *cct, if (found_start) { if (cb) { + dout(20) << "iterate_slo_parts()" + << " obj=" << part.obj_name + << " start_ofs=" << start_ofs + << " end_ofs=" << end_ofs + << dendl; + // SLO is a Swift thing, and Swift has no knowledge of S3 Policies. int r = cb(part.bucket, ent, part.bucket_acl, (part.bucket_policy ? @@ -1622,8 +1628,7 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl) part.obj_name = obj_name; part.size = entry.size_bytes; part.etag = entry.etag; - ldout(s->cct, 20) << "slo_part: ofs=" << ofs - << " bucket=" << part.bucket + ldout(s->cct, 20) << "slo_part: bucket=" << part.bucket << " obj=" << part.obj_name << " size=" << part.size << " etag=" << part.etag @@ -1647,6 +1652,10 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl) } total_len = end - ofs + 1; + ldout(s->cct, 20) << "Requested: ofs=" << ofs + << " end=" << end + << " total=" << total_len + << dendl; r = iterate_slo_parts(s->cct, store, ofs, end, slo_parts, get_obj_user_manifest_iterate_cb, (void *)this);