From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DC155138335 for ; Tue, 26 Nov 2019 20:32:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC16EE09BF; Tue, 26 Nov 2019 20:32:38 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5A15AE09C6 for ; Tue, 26 Nov 2019 20:32:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0206C34D42C for ; Tue, 26 Nov 2019 20:32:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CA8578BC for ; Tue, 26 Nov 2019 20:32:34 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1574800239.8c0c0208fdee299ea64250ea933c2a108a587f98.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch sys-fs/zfs/zfs-0.8.2-r1.ebuild sys-fs/zfs/zfs-0.8.2-r2.ebuild X-VCS-Directories: sys-fs/zfs/ sys-fs/zfs/files/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 8c0c0208fdee299ea64250ea933c2a108a587f98 X-VCS-Branch: master Date: Tue, 26 Nov 2019 20:32:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5a6dcbb9-30e5-4c3f-b66d-f1ff22b93383 X-Archives-Hash: 94cb8fc15e6fd5ce179294ddcb40d98d commit: 8c0c0208fdee299ea64250ea933c2a108a587f98 Author: Georgy Yakovlev gentoo org> AuthorDate: Tue Nov 26 19:54:20 2019 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Tue Nov 26 20:30:39 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c0c0208 sys-fs/zfs: revbump 0.8.2, include updated udev timeout patch Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Georgy Yakovlev gentoo.org> .../files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 61 +++++++++++++++------- .../{zfs-0.8.2-r1.ebuild => zfs-0.8.2-r2.ebuild} | 0 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch index 6c4054ddb66..be88f7bfee8 100644 --- a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch +++ b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch @@ -1,6 +1,6 @@ -From d7037d2a2fd57504070eba14634b8a7ea159de32 Mon Sep 17 00:00:00 2001 +From 803884217f9b9b5fb235d7c5e78a809d271f6387 Mon Sep 17 00:00:00 2001 From: Richard Yao -Date: Thu, 1 Aug 2019 15:54:30 -0400 +Date: Wed, 9 Oct 2019 12:16:12 -0700 Subject: [PATCH] Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS Since 0.7.0, zpool import would unconditionally block on udev for 30 @@ -15,38 +15,45 @@ have their own mechanisms for blocking until device nodes are ready zpool import to block on a non-existent udev until a timeout is reached inside of them. -Rather than trying to intelligently determine whether udev is avaliable +Rather than trying to intelligently determine whether udev is available on the system to avoid unnecessarily blocking in such environments, it seems best to just allow the environment to override the timeout. I propose that we add an environment variable called ZPOOL_IMPORT_UDEV_TIMEOUT_MS. Setting it to 0 would restore the 0.6.x -behavior that was more desireable in mdev based initramfs environments. -This allows the system userland utilities to be reused when building +behavior that was more desirable in mdev based initramfs environments. +This allows the system user land utilities to be reused when building mdev-based initramfs archives. +Reviewed-by: Igor Kozhukhov +Reviewed-by: Jorgen Lundman +Reviewed-by: Brian Behlendorf Reviewed-by: Georgy Yakovlev Signed-off-by: Richard Yao +Closes #9436 --- - lib/libzutil/zutil_import.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) + lib/libzutil/os/linux/zutil_import_os.c | 11 ++++++++++- + man/man8/zpool.8 | 6 ++++++ + 2 files changed, 16 insertions(+), 1 deletion(-) -diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c -index e82744383dc..8c4d8c5cb5c 100644 ---- a/lib/libzutil/zutil_import.c -+++ b/lib/libzutil/zutil_import.c -@@ -58,6 +58,7 @@ - #endif +diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c +index 811eae397c9..e51004edc68 100644 +--- a/lib/libzutil/os/linux/zutil_import_os.c ++++ b/lib/libzutil/os/linux/zutil_import_os.c +@@ -53,6 +53,7 @@ + #include #include #include +#include #include #include #include -@@ -1653,15 +1654,22 @@ zpool_open_func(void *arg) +@@ -181,17 +182,25 @@ zpool_open_func(void *arg) + if (rn->rn_labelpaths) { + char *path = NULL; char *devid = NULL; ++ char *env = NULL; rdsk_node_t *slice; avl_index_t where; -+ char *env; + int timeout; int error; @@ -54,9 +61,10 @@ index e82744383dc..8c4d8c5cb5c 100644 return; + env = getenv("ZPOOL_IMPORT_UDEV_TIMEOUT_MS"); -+ -+ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1) ++ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1 || ++ timeout < 0) { + timeout = DISK_LABEL_WAIT; ++ } + /* * Allow devlinks to stabilize so all paths are available. @@ -65,4 +73,21 @@ index e82744383dc..8c4d8c5cb5c 100644 + zpool_label_disk_wait(rn->rn_name, timeout); if (path != NULL) { - slice = zfs_alloc(hdl, sizeof (rdsk_node_t)); + slice = zutil_alloc(hdl, sizeof (rdsk_node_t)); +diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 +index 467d2411d40..df30b7ca05c 100644 +--- a/man/man8/zpool.8 ++++ b/man/man8/zpool.8 +@@ -2813,6 +2813,12 @@ Similar to the + option in + .Nm zpool import . + .El ++.Bl -tag -width "ZPOOL_IMPORT_UDEV_TIMEOUT_MS" ++.It Ev ZPOOL_IMPORT_UDEV_TIMEOUT_MS ++The maximum time in milliseconds that ++.Nm zpool import ++will wait for an expected device to be available. ++.El + .Bl -tag -width "ZPOOL_VDEV_NAME_GUID" + .It Ev ZPOOL_VDEV_NAME_GUID + Cause diff --git a/sys-fs/zfs/zfs-0.8.2-r1.ebuild b/sys-fs/zfs/zfs-0.8.2-r2.ebuild similarity index 100% rename from sys-fs/zfs/zfs-0.8.2-r1.ebuild rename to sys-fs/zfs/zfs-0.8.2-r2.ebuild