diff --git a/pkg/storaged/client.js b/pkg/storaged/client.js index dc31ccc12153..99aaba59c424 100644 --- a/pkg/storaged/client.js +++ b/pkg/storaged/client.js @@ -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]); @@ -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) { diff --git a/pkg/storaged/lvol-tabs.jsx b/pkg/storaged/lvol-tabs.jsx index 7edf4067ff8e..a1bd4c094f1e 100644 --- a/pkg/storaged/lvol-tabs.jsx +++ b/pkg/storaged/lvol-tabs.jsx @@ -28,7 +28,7 @@ import { ExclamationTriangleIcon, ExclamationCircleIcon } from "@patternfly/reac import { StorageButton, StorageLink, StorageOnOff } from "./storage-controls.jsx"; import { dialog_open, TextInput } from "./dialog.jsx"; import { get_resize_info, grow_dialog, shrink_dialog } from "./resize.jsx"; -import { fmt_size, decode_filename } from "./utils.js"; +import { fmt_size } from "./utils.js"; const _ = cockpit.gettext;