* [pve-devel] [PATCH installer] sys: block: fix inverted check when detecting block size
@ 2023-09-21 11:22 Christoph Heiss
2023-09-21 13:42 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Heiss @ 2023-09-21 11:22 UTC (permalink / raw)
To: pve-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-21 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21 11:22 [pve-devel] [PATCH installer] sys: block: fix inverted check when detecting block size Christoph Heiss
2023-09-21 13:42 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox