From: Casey Bodley Date: Tue, 21 Nov 2023 03:48:55 +0000 (-0500) Subject: rgw/s3: RGWGetObj still sets attrs on ReadOp error X-Git-Tag: v18.2.4~209^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=715c100794827a84ffb37c3b689615034f94bd22;p=ceph.git rgw/s3: RGWGetObj still sets attrs on ReadOp error when `ReadOp::prepare()` fails with `-ERR_NOT_MODIFIED`, it succeeded in reading the head object for mtime and attrs like etag. make those attrs available to RGWGetObj so we can still send ETag and other cache-related response headers Fixes: https://tracker.ceph.com/issues/45736 Signed-off-by: Casey Bodley (cherry picked from commit ccd241c565aa898231e4bfa4ea313c3406b55391) Conflicts: src/rgw/rgw_op.cc no multipart get part --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 71fb198f362..7890eddd827 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2229,11 +2229,11 @@ void RGWGetObj::execute(optional_yield y) read_op->params.lastmod = &lastmod; op_ret = read_op->prepare(s->yield, this); - if (op_ret < 0) - goto done_err; version_id = s->object->get_instance(); s->obj_size = s->object->get_obj_size(); attrs = s->object->get_attrs(); + if (op_ret < 0) + goto done_err; /* STAT ops don't need data, and do no i/o */ if (get_type() == RGW_OP_STAT_OBJ) {