public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] sys: block: fix inverted check when detecting block size
Date: Thu, 21 Sep 2023 13:22:56 +0200	[thread overview]
Message-ID: <20230921112259.600582-1-c.heiss@proxmox.com> (raw)

We do actually want the block size if it is integer - currently, it is
always set to `undef` (and then `null` in the serialized JSON).

Fixes: 15b2cd7 ("sys: block: fix possible use of `undef`-value when detecting disk sizes")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 Proxmox/Sys/Block.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Proxmox/Sys/Block.pm b/Proxmox/Sys/Block.pm
index f76e0f1..7593495 100644
--- a/Proxmox/Sys/Block.pm
+++ b/Proxmox/Sys/Block.pm
@@ -104,7 +104,7 @@ my sub hd_list {
 
 	my $logical_bsize = file_read_firstline("$bd/queue/logical_block_size") // '';
 	chomp $logical_bsize;
-	if ($logical_bsize && $logical_bsize !~ m/^\d+$/) {
+	if ($logical_bsize && $logical_bsize =~ m/^\d+$/) {
 	    $logical_bsize = int($logical_bsize);
 	} else {
 	    $logical_bsize = undef;
-- 
2.41.0





             reply	other threads:[~2023-09-21 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 11:22 Christoph Heiss [this message]
2023-09-21 13:42 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230921112259.600582-1-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal