]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-bluestore-tool: optimize offline trim report info 59633/head
authorYite Gu <yitegu0@gmail.com>
Fri, 6 Sep 2024 10:00:46 +0000 (18:00 +0800)
committerYite Gu <yitegu0@gmail.com>
Sat, 7 Sep 2024 06:23:26 +0000 (14:23 +0800)
Fixes: https://tracker.ceph.com/issues/67932
Signed-off-by: Yite Gu <yitegu0@gmail.com>
src/os/bluestore/BlueFS.cc

index 4ad76faa76d241a8e389edf9596bd86445d61bf3..516d2bd2e8ce0cea723d5d432c18d5b6bd6435a4 100644 (file)
@@ -4817,11 +4817,16 @@ void BlueFS::trim_free_space(const string& type, std::ostream& outss)
     outss << "device " << type << " is not configured";
     return;
   }
-  if (alloc[bdev_id] && !is_shared_alloc(bdev_id)) {
+  if (alloc[bdev_id]) {
     if (!bdev[bdev_id]->is_discard_supported()) {
       outss << "device " << type << " does not support trim";
       return;
     }
+    if (is_shared_alloc(bdev_id)) {
+      outss << "device " << type
+            << " shares allocations with main device, trimming skipped.";
+      return;
+    }
     alloc[bdev_id]->foreach(iterated_allocation);
     outss << "device " << type << " trim done";
   }