]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
d4n/directory: Fix oid for directory blocks
authorSamarah <samarah.uriarte@ibm.com>
Tue, 20 Feb 2024 15:39:28 +0000 (15:39 +0000)
committerPritha Srivastava <prsrivas@redhat.com>
Tue, 2 Apr 2024 15:54:52 +0000 (21:24 +0530)
Signed-off-by: Samarah <samarah.uriarte@ibm.com>
src/rgw/driver/d4n/rgw_sal_d4n.cc

index 39dbd5772d95ea0e1a4a53574355be0ea7fa07d0..1e297b01e61da6f40199edd7bcf9331722dea8ab 100644 (file)
@@ -764,10 +764,11 @@ int D4NFilterObject::D4NFilterReadOp::D4NFilterGetCB::handle_data(bufferlist& bl
       }
     } else if (bl.length() == rgw_get_obj_max_req_size && bl_rem.length() == 0) { // if bl is the same size as rgw_get_obj_max_req_size, write it to cache
       std::string oid = prefix + "_" + std::to_string(ofs) + "_" + std::to_string(bl_len);
-      ofs += bl_len;
       block.blockID = ofs;
       block.size = bl.length();
       block.version = version;
+      ofs += bl_len;
+
       if (!filter->get_policy_driver()->get_cache_policy()->exist_key(oid)) {
         auto ret = filter->get_policy_driver()->get_cache_policy()->eviction(dpp, block.size, *y);
         if (ret == 0) {
@@ -811,10 +812,11 @@ int D4NFilterObject::D4NFilterReadOp::D4NFilterGetCB::handle_data(bufferlist& bl
       if (bl_rem.length() == rgw_get_obj_max_req_size) {
         std::string oid = prefix + "_" + std::to_string(ofs) + "_" + std::to_string(bl_rem.length());
           if (!filter->get_policy_driver()->get_cache_policy()->exist_key(oid)) {
-          ofs += bl_rem.length();
           block.blockID = ofs;
           block.size = bl_rem.length();
           block.version = version;
+          ofs += bl_rem.length();
+
           auto ret = filter->get_policy_driver()->get_cache_policy()->eviction(dpp, block.size, *y);
           if (ret == 0) {
             ret = filter->get_cache_driver()->put(dpp, oid, bl_rem, bl_rem.length(), attrs, *y);