Unlock devices file at the end of cmd processing, after all the PVs are
processed, not after the first processed PV.
Before this patch:
❯ pvchange -u /dev/sda /dev/sdb
Physical volume "/dev/sda" changed
WARNING: Devices file unlock no fd.
Physical volume "/dev/sdb" changed
2 physical volumes changed / 0 physical volumes not changed
With this patch applied:
❯ pvchange -u /dev/sda /dev/sdb
Physical volume "/dev/sda" changed
Physical volume "/dev/sdb" changed
2 physical volumes changed / 0 physical volumes not changed
The lvm_run_command/devices_file_exit/unlock_devices_file will
do the unlock at the very end of cmd processing.
log_error("Failed to set pvid for devices file.");
if (!device_ids_write(cmd))
log_warn("Failed to update devices file.");
- unlock_devices_file(cmd);
+ //unlock_devices_file(cmd);
}
log_print_unless_silent("Physical volume \"%s\" changed", pv_name);