1 |
commit: 8c0c0208fdee299ea64250ea933c2a108a587f98 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 26 19:54:20 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 26 20:30:39 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c0c0208 |
7 |
|
8 |
sys-fs/zfs: revbump 0.8.2, include updated udev timeout patch |
9 |
|
10 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
.../files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 61 +++++++++++++++------- |
14 |
.../{zfs-0.8.2-r1.ebuild => zfs-0.8.2-r2.ebuild} | 0 |
15 |
2 files changed, 43 insertions(+), 18 deletions(-) |
16 |
|
17 |
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 |
18 |
index 6c4054ddb66..be88f7bfee8 100644 |
19 |
--- a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch |
20 |
+++ b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch |
21 |
@@ -1,6 +1,6 @@ |
22 |
-From d7037d2a2fd57504070eba14634b8a7ea159de32 Mon Sep 17 00:00:00 2001 |
23 |
+From 803884217f9b9b5fb235d7c5e78a809d271f6387 Mon Sep 17 00:00:00 2001 |
24 |
From: Richard Yao <ryao@g.o> |
25 |
-Date: Thu, 1 Aug 2019 15:54:30 -0400 |
26 |
+Date: Wed, 9 Oct 2019 12:16:12 -0700 |
27 |
Subject: [PATCH] Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS |
28 |
|
29 |
Since 0.7.0, zpool import would unconditionally block on udev for 30 |
30 |
@@ -15,38 +15,45 @@ have their own mechanisms for blocking until device nodes are ready |
31 |
zpool import to block on a non-existent udev until a timeout is reached |
32 |
inside of them. |
33 |
|
34 |
-Rather than trying to intelligently determine whether udev is avaliable |
35 |
+Rather than trying to intelligently determine whether udev is available |
36 |
on the system to avoid unnecessarily blocking in such environments, it |
37 |
seems best to just allow the environment to override the timeout. I |
38 |
propose that we add an environment variable called |
39 |
ZPOOL_IMPORT_UDEV_TIMEOUT_MS. Setting it to 0 would restore the 0.6.x |
40 |
-behavior that was more desireable in mdev based initramfs environments. |
41 |
-This allows the system userland utilities to be reused when building |
42 |
+behavior that was more desirable in mdev based initramfs environments. |
43 |
+This allows the system user land utilities to be reused when building |
44 |
mdev-based initramfs archives. |
45 |
|
46 |
+Reviewed-by: Igor Kozhukhov <igor@×××××.org> |
47 |
+Reviewed-by: Jorgen Lundman <lundman@×××××××.net> |
48 |
+Reviewed-by: Brian Behlendorf <behlendorf1@××××.gov> |
49 |
Reviewed-by: Georgy Yakovlev <gyakovlev@g.o> |
50 |
Signed-off-by: Richard Yao <ryao@g.o> |
51 |
+Closes #9436 |
52 |
--- |
53 |
- lib/libzutil/zutil_import.c | 10 +++++++++- |
54 |
- 1 file changed, 9 insertions(+), 1 deletion(-) |
55 |
+ lib/libzutil/os/linux/zutil_import_os.c | 11 ++++++++++- |
56 |
+ man/man8/zpool.8 | 6 ++++++ |
57 |
+ 2 files changed, 16 insertions(+), 1 deletion(-) |
58 |
|
59 |
-diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c |
60 |
-index e82744383dc..8c4d8c5cb5c 100644 |
61 |
---- a/lib/libzutil/zutil_import.c |
62 |
-+++ b/lib/libzutil/zutil_import.c |
63 |
-@@ -58,6 +58,7 @@ |
64 |
- #endif |
65 |
+diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c |
66 |
+index 811eae397c9..e51004edc68 100644 |
67 |
+--- a/lib/libzutil/os/linux/zutil_import_os.c |
68 |
++++ b/lib/libzutil/os/linux/zutil_import_os.c |
69 |
+@@ -53,6 +53,7 @@ |
70 |
+ #include <libgen.h> |
71 |
#include <stddef.h> |
72 |
#include <stdlib.h> |
73 |
+#include <stdio.h> |
74 |
#include <string.h> |
75 |
#include <sys/stat.h> |
76 |
#include <unistd.h> |
77 |
-@@ -1653,15 +1654,22 @@ zpool_open_func(void *arg) |
78 |
+@@ -181,17 +182,25 @@ zpool_open_func(void *arg) |
79 |
+ if (rn->rn_labelpaths) { |
80 |
+ char *path = NULL; |
81 |
char *devid = NULL; |
82 |
++ char *env = NULL; |
83 |
rdsk_node_t *slice; |
84 |
avl_index_t where; |
85 |
-+ char *env; |
86 |
+ int timeout; |
87 |
int error; |
88 |
|
89 |
@@ -54,9 +61,10 @@ index e82744383dc..8c4d8c5cb5c 100644 |
90 |
return; |
91 |
|
92 |
+ env = getenv("ZPOOL_IMPORT_UDEV_TIMEOUT_MS"); |
93 |
-+ |
94 |
-+ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1) |
95 |
++ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1 || |
96 |
++ timeout < 0) { |
97 |
+ timeout = DISK_LABEL_WAIT; |
98 |
++ } |
99 |
+ |
100 |
/* |
101 |
* Allow devlinks to stabilize so all paths are available. |
102 |
@@ -65,4 +73,21 @@ index e82744383dc..8c4d8c5cb5c 100644 |
103 |
+ zpool_label_disk_wait(rn->rn_name, timeout); |
104 |
|
105 |
if (path != NULL) { |
106 |
- slice = zfs_alloc(hdl, sizeof (rdsk_node_t)); |
107 |
+ slice = zutil_alloc(hdl, sizeof (rdsk_node_t)); |
108 |
+diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 |
109 |
+index 467d2411d40..df30b7ca05c 100644 |
110 |
+--- a/man/man8/zpool.8 |
111 |
++++ b/man/man8/zpool.8 |
112 |
+@@ -2813,6 +2813,12 @@ Similar to the |
113 |
+ option in |
114 |
+ .Nm zpool import . |
115 |
+ .El |
116 |
++.Bl -tag -width "ZPOOL_IMPORT_UDEV_TIMEOUT_MS" |
117 |
++.It Ev ZPOOL_IMPORT_UDEV_TIMEOUT_MS |
118 |
++The maximum time in milliseconds that |
119 |
++.Nm zpool import |
120 |
++will wait for an expected device to be available. |
121 |
++.El |
122 |
+ .Bl -tag -width "ZPOOL_VDEV_NAME_GUID" |
123 |
+ .It Ev ZPOOL_VDEV_NAME_GUID |
124 |
+ Cause |
125 |
|
126 |
diff --git a/sys-fs/zfs/zfs-0.8.2-r1.ebuild b/sys-fs/zfs/zfs-0.8.2-r2.ebuild |
127 |
similarity index 100% |
128 |
rename from sys-fs/zfs/zfs-0.8.2-r1.ebuild |
129 |
rename to sys-fs/zfs/zfs-0.8.2-r2.ebuild |