]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
RGW - Set the mtime on ReadOp in RadosStore
authorDaniel Gryniewicz <dang@fprintf.net>
Fri, 18 Apr 2025 13:56:46 +0000 (09:56 -0400)
committerShilpa Jagannath <smanjara@redhat.com>
Thu, 1 May 2025 23:42:18 +0000 (19:42 -0400)
Make sure the mtime is updated every time you call ReadOp::prepare() via
RadosStore.  Uninitialized mtime is the epoch (Jan 1 1970).

Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
(cherry picked from commit b664449e89bfc22cd6f062ad7dc271ea6756a1c5)

src/rgw/driver/rados/rgw_sal_rados.cc

index 9a719bcbd946073076fcc5e494c91c3899689cc6..a804bd0c00a19a3ad9d5157c2d4426024f44699a 100644 (file)
@@ -3426,6 +3426,11 @@ RadosObject::RadosReadOp::RadosReadOp(RadosObject *_source, RGWObjectCtx *_octx)
 int RadosObject::RadosReadOp::prepare(optional_yield y, const DoutPrefixProvider* dpp)
 {
   uint64_t obj_size;
+  ceph::real_time mtime;
+
+  if (!params.lastmod) {
+    params.lastmod = &mtime;
+  }
 
   parent_op.conds.mod_ptr = params.mod_ptr;
   parent_op.conds.unmod_ptr = params.unmod_ptr;
@@ -3446,6 +3451,7 @@ int RadosObject::RadosReadOp::prepare(optional_yield y, const DoutPrefixProvider
 
   source->set_instance(parent_op.state.obj.key.instance);
   source->set_obj_size(obj_size);
+  source->set_mtime(*params.lastmod);
   params.parts_count = parent_op.params.parts_count;
 
   return ret;