]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/s3: RGWGetObj still sets attrs on ReadOp error 54587/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 21 Nov 2023 03:48:55 +0000 (22:48 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 24 Nov 2023 15:36:28 +0000 (10:36 -0500)
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>
src/rgw/rgw_op.cc

index 6a7a7313e11710681120264fde4732eef918f740..efc0053c8a275414bbfe64c13d71746f91c040cf 100644 (file)
@@ -2286,12 +2286,12 @@ void RGWGetObj::execute(optional_yield y)
   }
 
   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();
   multipart_parts_count = read_op->params.parts_count;
+  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) {