Skip to content

Commit

Permalink
storage: Don't show LV structure for device-mapper PVs.
Browse files Browse the repository at this point in the history
See storaged-project/udisks#1206 for why this
is unfortunately broken right now.
  • Loading branch information
mvollmer committed Oct 30, 2023
1 parent 8be0441 commit 1e2e3f4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,24 @@ function update_indices() {
client.vgnames_vgroup[vgroup.Name] = vgroup;
}

const vgroups_with_dm_pvs = { };

client.vgroups_pvols = { };
for (path in client.vgroups) {
client.vgroups_pvols[path] = [];
}
for (path in client.blocks_pvol) {
pvol = client.blocks_pvol[path];
if (client.vgroups_pvols[pvol.VolumeGroup] !== undefined)
if (client.vgroups_pvols[pvol.VolumeGroup] !== undefined) {
client.vgroups_pvols[pvol.VolumeGroup].push(pvol);
{
// HACK - this is needed below to deal with a UDisks2 bug.
// https://github.com/storaged-project/udisks/pull/1206
const block = client.blocks[path];
if (block && utils.decode_filename(block.Device).indexOf("/dev/dm-") == 0)
vgroups_with_dm_pvs[pvol.VolumeGroup] = true;
}
}
}
function cmp_pvols(a, b) {
return utils.block_cmp(client.blocks[a.path], client.blocks[b.path]);
Expand Down Expand Up @@ -351,6 +361,14 @@ function update_indices() {
const struct = client.lvols[path].Structure;
const lvol = client.lvols[path];

// HACK - UDisks2 can't find the PVs of a segment when they
// are on a device mapper device.
//
// https://github.com/storaged-project/udisks/pull/1206

if (vgroups_with_dm_pvs[lvol.VolumeGroup])
continue;

let summary;
let status = "";
if (lvol.Layout != "thin" && struct && struct.segments) {
Expand Down

0 comments on commit 1e2e3f4

Please sign in to comment.