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 69D47B821D for ; Thu, 7 Mar 2024 08:49:45 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3FA8F32453 for ; Thu, 7 Mar 2024 08:49:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 7 Mar 2024 08:49:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6DD8D42901 for ; Thu, 7 Mar 2024 08:49:13 +0100 (CET) Date: Thu, 7 Mar 2024 08:49:12 +0100 (CET) From: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= To: Proxmox VE development discussion , Stoiko Ivanov Message-ID: <196398704.9672.1709797752512@webmail.proxmox.com> In-Reply-To: <20240306132436.1214390-3-s.ivanov@proxmox.com> References: <20240306132436.1214390-1-s.ivanov@proxmox.com> <20240306132436.1214390-3-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev59 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL -0.184 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 KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH zfsonlinux v2 2/2] fix #5288: cherry-pick fix for udev-partition links > 16 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: Thu, 07 Mar 2024 07:49:45 -0000 > Stoiko Ivanov hat am 06.03.2024 14:24 CET geschrie= ben: >=20 > =20 > see: > https://github.com/openzfs/zfs/pull/15970 > https://github.com/openzfs/zfs/issues/15904 >=20 > for some additional background. FWIW, this one got two approvals upstream in the meantime ;) > Signed-off-by: Stoiko Ivanov > --- > ...rectly-handle-partition-16-and-later.patch | 52 +++++++++++++++++++ > debian/patches/series | 1 + > 2 files changed, 53 insertions(+) > create mode 100644 debian/patches/0012-udev-correctly-handle-partition-1= 6-and-later.patch >=20 > diff --git a/debian/patches/0012-udev-correctly-handle-partition-16-and-l= ater.patch b/debian/patches/0012-udev-correctly-handle-partition-16-and-lat= er.patch > new file mode 100644 > index 00000000..578b74bd > --- /dev/null > +++ b/debian/patches/0012-udev-correctly-handle-partition-16-and-later.pa= tch > @@ -0,0 +1,52 @@ > +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 > +From: =3D?UTF-8?q?Fabian=3D20Gr=3DC3=3DBCnbichler?=3D > +Date: Wed, 6 Mar 2024 10:39:06 +0100 > +Subject: [PATCH] udev: correctly handle partition #16 and later > +MIME-Version: 1.0 > +Content-Type: text/plain; charset=3DUTF-8 > +Content-Transfer-Encoding: 8bit > + > +If a zvol has more than 15 partitions, the minor device number exhausts > +the slot count reserved for partitions next to the zvol itself. As a > +result, the minor number cannot be used to determine the partition > +number for the higher partition, and doing so results in wrong named > +symlinks being generated by udev. > + > +Since the partition number is encoded in the block device name anyway, > +let's just extract it from there instead. > + > +Fixes: #15904 > + > +Signed-off-by: Fabian Gr=C3=BCnbichler > +Signed-off-by: Stoiko Ivanov > +--- > + udev/zvol_id.c | 9 +++++---- > + 1 file changed, 5 insertions(+), 4 deletions(-) > + > +diff --git a/udev/zvol_id.c b/udev/zvol_id.c > +index 5960b9787..609349594 100644 > +--- a/udev/zvol_id.c > ++++ b/udev/zvol_id.c > +@@ -51,7 +51,7 @@ const char *__asan_default_options(void) { > + int > + main(int argc, const char *const *argv) > + { > +-=09if (argc !=3D 2) { > ++=09if (argc !=3D 2 || strncmp(argv[1], "/dev/zd", 7) !=3D 0) { > + =09=09fprintf(stderr, "usage: %s /dev/zdX\n", argv[0]); > + =09=09return (1); > + =09} > +@@ -72,9 +72,10 @@ main(int argc, const char *const *argv) > + =09=09return (1); > + =09} > +=20 > +-=09unsigned int dev_part =3D minor(sb.st_rdev) % ZVOL_MINORS; > +-=09if (dev_part !=3D 0) > +-=09=09sprintf(zvol_name + strlen(zvol_name), "-part%u", dev_part); > ++=09const char *dev_part =3D strrchr(dev_name, 'p'); > ++=09if (dev_part !=3D NULL) { > ++=09=09sprintf(zvol_name + strlen(zvol_name), "-part%s", dev_part + 1); > ++=09} > +=20 > + =09for (size_t i =3D 0; i < strlen(zvol_name); ++i) > + =09=09if (isblank(zvol_name[i])) > diff --git a/debian/patches/series b/debian/patches/series > index 35f81d13..9eedf857 100644 > --- a/debian/patches/series > +++ b/debian/patches/series > @@ -9,3 +9,4 @@ > 0009-arc-stat-summary-guard-access-to-l2arc-MFU-MRU-stats.patch > 0010-Fix-nfs_truncate_shares-without-etc-exports.d.patch > 0011-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch > +0012-udev-correctly-handle-partition-16-and-later.patch > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel