]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Annotated Striper.cc and PrimaryLogPG.cc 58036/head
authorSuyash Dongre <suyashd999@gmail.com>
Thu, 13 Jun 2024 14:59:25 +0000 (20:29 +0530)
committerSuyash Dongre <suyashd999@gmail.com>
Tue, 18 Jun 2024 15:16:01 +0000 (20:46 +0530)
1. src/osd/PrimaryLogPG.cc:

It's safe to use  clear() on operand that has been moved.
reference: https://github.com/ceph/ceph/pull/48839/files

2. src/osdc/Striper.cc:

This is a false-positive because in the loop the bufferlist is only being moved when the size of the buffer_extents is equal to 1 otherwise it will not move
reference: https://github.com/ceph/ceph/blob/e879ce83c084f1a96e5dd0ab2b57bf909cfa423d/src/osdc/Striper.cc#L411-L415

Signed-off-by: Suyash Dongre <suyashd999@gmail.com>
src/osd/PrimaryLogPG.cc
src/osdc/Striper.cc

index 1dc991ea8ce61ed01b14b7eead99c657778a4d6b..5be9b8be62f50ef8f0e2c6d75955c572d5b9a611 100644 (file)
@@ -4904,7 +4904,7 @@ int PrimaryLogPG::trim_object(
     encode(snapset, bl);
     attrs[SS_ATTR] = std::move(bl);
 
-    bl.clear();
+    bl.clear(); //NOLINT(bugprone-use-after-move)
     encode(head_obc->obs.oi, bl,
             get_osdmap()->get_features(CEPH_ENTITY_TYPE_OSD, nullptr));
     attrs[OI_ATTR] = std::move(bl);
index 69bdda06f84cf5937239930df5595abaf79db828..d45828d15c564b9ea1e6e3929cd690bf9b92b7b3 100644 (file)
@@ -407,7 +407,7 @@ void Striper::StripedReadResult::add_partial_result(
                 << " to " << buffer_extents << dendl;
   for (auto& be : buffer_extents) {
     auto& r = partial[be.first];
-    size_t actual = std::min<uint64_t>(bl.length(), be.second);
+    size_t actual = std::min<uint64_t>(bl.length(), be.second); //NOLINT(bugprone-use-after-move)
     if (buffer_extents.size() == 1) {
       r.first = std::move(bl);
     } else {