Fixes: https://tracker.ceph.com/issues/67932
Signed-off-by: Yite Gu <yitegu0@gmail.com>
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";
}