Skip to content

Commit

Permalink
rgw/s3: RGWGetObj still sets attrs on ReadOp error
Browse files Browse the repository at this point in the history
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 <cbodley@redhat.com>
  • Loading branch information
cbodley committed Nov 21, 2023
1 parent 6d5ae79 commit 23837a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rgw/rgw_op.cc
Expand Up @@ -2283,11 +2283,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) {
Expand Down

0 comments on commit 23837a1

Please sign in to comment.