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 20, 2023
1 parent ea601f2 commit c47e5cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion pkg/storaged/lvol-tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c47e5cb

Please sign in to comment.