From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 71A1F5B8BC for ; Tue, 7 Jul 2020 16:21:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 606F628FEE for ; Tue, 7 Jul 2020 16:21:20 +0200 (CEST) Received-SPF: none (nena.proxmox.com: No applicable sender policy available) receiver=firstgate.proxmox.com; identity=mailfrom; envelope-from="mira@nena.proxmox.com"; helo=proxmox-new.maurer-it.com; client-ip=212.186.127.180 Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 59D9428FE5 for ; Tue, 7 Jul 2020 16:21:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E743F42A51 for ; Tue, 7 Jul 2020 16:14:58 +0200 (CEST) From: Mira Limbeck To: pve-devel@lists.proxmox.com Date: Tue, 7 Jul 2020 16:14:54 +0200 Message-Id: <20200707141454.2484-1-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [iscsiplugin.pm] Subject: [pve-devel] [PATCH storage] fix #2460: use dm-uuid-mpath- as fallback for multipath X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 14:21:20 -0000 With Debian Buster it looks like the 'scsi-' method is no longer reliable. In addition to that, which is also used for non-multipath systems, add the 'dm-uuid-mpath-' method as fallback. This is also used by openstack (see os-brick https://github.com/openstack/os-brick/blob/39b201160bbff39117fca46b2709ff3f74c53d80/os_brick/initiator/linuxscsi.py#L400) Also sort the output of readdir so 'scsi-' is always after 'dm-uuid-mpath-' so the output of pvesm list does not change for systems that worked before. Signed-off-by: Mira Limbeck --- PVE/Storage/ISCSIPlugin.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm index d5cb733..f2694ba 100644 --- a/PVE/Storage/ISCSIPlugin.pm +++ b/PVE/Storage/ISCSIPlugin.pm @@ -151,11 +151,11 @@ sub load_stable_scsi_paths { my $stabledir = "/dev/disk/by-id"; if (my $dh = IO::Dir->new($stabledir)) { - while (defined(my $tmp = $dh->read)) { + foreach my $tmp (sort $dh->read) { # exclude filenames with part in name (same disk but partitions) # use only filenames with scsi(with multipath i have the same device # with dm-uuid-mpath , dm-name and scsi in name) - if($tmp !~ m/-part\d+$/ && $tmp =~ m/^scsi-/) { + if($tmp !~ m/-part\d+$/ && ($tmp =~ m/^scsi-/ || $tmp =~ m/^dm-uuid-mpath-/)) { my $path = "$stabledir/$tmp"; my $bdevdest = readlink($path); if ($bdevdest && $bdevdest =~ m|^../../([^/]+)|) { -- 2.20.1