[pve-devel] [PATCH storage] disks: add a guard possible nonexistent field

Maximiliano Sandoval m.sandoval at proxmox.com
Fri Oct 24 14:13:09 CEST 2025


When running

    pveceph osd create <device>

one would get one or two warnings:

    Use of uninitialized value in pattern match (m//) at /usr/share/perl5/PVE/Diskmanage.pm line 317.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/PVE/Diskmanage.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/Diskmanage.pm b/src/PVE/Diskmanage.pm
index 1062bfdf..d1cf24da 100644
--- a/src/PVE/Diskmanage.pm
+++ b/src/PVE/Diskmanage.pm
@@ -316,6 +316,7 @@ sub get_ceph_volume_infos {
                 # $result autovivification is wanted, to not creating empty hashes
                 if (
                     ($type eq 'block' || $type eq 'data')
+                    && $fields->[2]
                     && $fields->[2] =~ m/ceph.osd_id=([^,]+)/
                 ) {
                     $result->{$dev}->{osdid} = $1;
-- 
2.47.3





More information about the pve-devel mailing list