From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 3A3BF1FF143 for ; Sat, 23 May 2026 23:29:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7D98A1BB88; Sat, 23 May 2026 23:29:16 +0200 (CEST) From: Thomas Lamprecht To: Proxmox VE development discussion , Mira Limbeck Subject: Re: [PATCH v2 storage 08/15] iscsi: rework to update discovery db and simplify login Date: Sat, 23 May 2026 23:26:11 +0200 Message-ID: <20260523212856.2822353-6-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260430173220.441001-9-m.limbeck@proxmox.com> References: <20260430173220.441001-1-m.limbeck@proxmox.com> <20260430173220.441001-9-m.limbeck@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779571725502 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: K6EQH2N6FLO34DYKHVLTN7TF5FEYFUZF X-Message-ID-Hash: K6EQH2N6FLO34DYKHVLTN7TF5FEYFUZF X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 30 Apr 2026 19:27:06 +0200, Mira Limbeck wrote:=0D > diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin= .pm=0D > @@ -699,32 +703,30 @@ sub activate_storage {=0D > my $do_login =3D 0;=0D > + my $login_targets =3D {};=0D > for my $target (keys $targets->%*) {=0D > - $do_login =3D 1 if !defined($targets->{$target}->{sessions});=0D > - }=0D > -=0D > - if (!$do_login) {=0D > - # We should check that sessions for all portals are available=0D > - for my $target (keys $targets->%*) {=0D > - my $session_portals =3D [map { $_->{portal} } ($targets->{$t= arget}->{sessions}->@*)];=0D > - for my $portal ($targets->{$target}->{portals}->@*) {=0D > - if (!grep(/^\Q$portal\E(?::3260)?$/, $session_portals->@= *)) {=0D > - $do_login =3D 1;=0D > - last;=0D > - }=0D > + my $sessions =3D [map { $_->{portal} } ($targets->{$target}->{se= ssions}->@*)];=0D > + for my $portal ($targets->{$target}->{portals}->@*) {=0D > + if (!grep(/\Q$portal\E$/, $sessions->@*)) {=0D > + push $login_targets->{$target}->@*, $portal;=0D > }=0D > }=0D > }=0D =0D This dropped the leading `^` anchor that the removed code had. With only th= e=0D trailing `$` the config portal is matched as a suffix of the session string= ,=0D so e.g. "10.0.0.4:3260" matches a session for host "110.0.0.4". Any reason= =0D for not keeping the exact `^...$` match?=0D =0D > @@ -259,7 +256,14 @@ sub iscsi_login {=0D > - run_command([$ISCSIADM, '--mode', 'node', '--targetname', $target, '= --login']);=0D > + # iscsiadm warns if some target/portals are already logged in=0D > + # a workaround would be to check each of them and only log in on tho= se=0D > + # that have no session yet, rather than just doing a log in per node= =0D > + my $cmd =3D [=0D > + $ISCSIADM, '--mode', 'node', '--targetname', $target, '--login',= =0D > + ];=0D > + eval { run_command($cmd); };=0D > + warn $@ if $@;=0D =0D Login was an un-evaled hard call before; now a total login failure only=0D warns and activate_storage returns success, while check_connection only=0D pings portals - so activation can report success with zero usable LUNs.=0D Might be still worth distinguishing "all logins failed" and propagating=0D that.=0D