[pve-devel] [PATCH storage] diskmanage: fix device encoding handling
Wolfgang Bumiller
w.bumiller at proxmox.com
Mon Feb 4 10:42:01 CET 2019
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
PVE/Diskmanage.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 854f0a5..66b264a 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -566,8 +566,8 @@ sub get_partnum {
my ($mode, $rdev) = (stat($part_path))[2,6];
next if !$mode || !S_ISBLK($mode) || !$rdev;
- my $major = int($rdev / 0x100);
- my $minor = $rdev % 0x100;
+ my $major = PVE::Tools::dev_t_major($rdev);
+ my $minor = PVE::Tools::dev_t_minor($rdev);
my $partnum_path = "/sys/dev/block/$major:$minor/";
my $partnum;
--
2.11.0
More information about the pve-devel
mailing list