From: "Richard Yao" <ryao@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:ryao commit in: defaults/
Date: Sun, 9 Jun 2013 13:37:51 +0000 (UTC) [thread overview]
Message-ID: <1370785018.2ccc6fc53812d83e458a2e69afdf63cf0c9c449a.ryao@gentoo> (raw)
commit: 2ccc6fc53812d83e458a2e69afdf63cf0c9c449a
Author: Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 9 13:13:58 2013 +0000
Commit: Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Jun 9 13:36:58 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=2ccc6fc5
Workaround busybox modprobe's inability to load ZFS modules
Commit 3a054014e880e5b1ff28e3d87767c45a073da6b5 replaced our modprobe
with busybox's modprobe. Unfortunately, busybox's modprobe appears to be
unable to properly load modules with more than 1 level of dependencies.
The zfs and zpool commands will invoke modprobe if /dev/zvol is missing,
which concealed this problem. However, this caused problems because some
invocations would fail and under certain circumstances, init would be
killed, causing a kernel panic. This issue was made clear by commit
71d35173727dc968d7baa2107accb99ebbc5b188, which ensured that the zpool
and zfs commands were not run until the ZFS module was loaded.
busybox modprobe's failure to load module dependencies correctly appears
to occur because busybox modprobe does not wait until until a module is
loaded before loading a module that depends on it, which is a race. It
would be best to correct this race by waiting until the module has
properly loaded, but it is not clear that the race is the only thing
going wrong and developer time is a premium.
We implement a workaround by modifying the busy loop added in the
previous commit to explicit call `modprobe zfs` on each iteration. While
the first few calls fail due to bugs in busybox modprobe, it will
eventually work, after which each call is a noop. This lets us keep
looping until either the loop exit condition that /dev/zvol exist is
reached or the 5 second timeout is reached.
Once the busybox modprobe issue is fixed, this workaround should be safe
to revert.
Signed-off-by: Richard Yao <ryao <AT> gentoo.org>
---
defaults/initrd.scripts | 5 +++--
defaults/linuxrc | 2 --
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index f598402..73c0f0c 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -637,9 +637,10 @@ chooseKeymap() {
}
# This helper function is to be called using call_func_timeout.
-# It enables us to wait a reasonable amount of time until /dev/zfs appears.
+# This works around the inability of busybox modprobe to handle complex module dependencies.
+# This also enables us to wait a reasonable amount of time until /dev/zfs appears.
waitForZFS() {
- while [ ! -c /dev/zfs ]; do echo >/dev/null; done;
+ while [ ! -c /dev/zfs ]; do modprobe zfs 2> /dev/null; done;
}
startVolumes() {
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 3784456..d6d0eaa 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -307,8 +307,6 @@ then
break
fi
done
-
- [ "USE_ZFS" = "1" ] && MY_HWOPTS="${MY_HWOPTS} zfs"
fi
splash 'init'
next reply other threads:[~2013-06-09 13:37 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-09 13:37 Richard Yao [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-10-02 12:43 [gentoo-commits] proj/genkernel:ryao commit in: defaults/ Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 Richard Yao
2013-06-09 13:57 [gentoo-commits] proj/genkernel:master " Richard Yao
2013-06-09 13:57 ` [gentoo-commits] proj/genkernel:ryao " Richard Yao
2013-06-09 13:57 [gentoo-commits] proj/genkernel:master " Richard Yao
2013-06-09 13:57 ` [gentoo-commits] proj/genkernel:ryao " Richard Yao
2013-06-09 13:48 [gentoo-commits] proj/genkernel:master " Richard Yao
2013-06-09 13:57 ` [gentoo-commits] proj/genkernel:ryao " Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:40 Richard Yao
2013-06-09 13:37 Richard Yao
2013-06-09 13:37 Richard Yao
2013-06-09 13:36 Richard Yao
2013-06-09 13:36 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:33 Richard Yao
2013-06-09 13:21 Richard Yao
2013-06-09 13:17 Richard Yao
2013-06-09 13:17 Richard Yao
2013-06-09 13:17 Richard Yao
2013-06-09 13:17 Richard Yao
2013-06-09 13:15 Richard Yao
2013-06-09 13:15 Richard Yao
2013-06-09 12:29 Richard Yao
2013-06-09 12:11 Richard Yao
2013-06-09 11:56 Richard Yao
2013-06-09 11:51 Richard Yao
2013-06-09 11:47 Richard Yao
2013-06-09 11:43 Richard Yao
2013-06-09 10:28 Richard Yao
2013-06-09 10:05 Richard Yao
2013-06-09 10:02 Richard Yao
2013-06-09 9:58 Richard Yao
2013-06-09 9:58 Richard Yao
2013-06-09 9:58 Richard Yao
2013-06-09 9:53 Richard Yao
2013-06-09 9:49 Richard Yao
2013-06-09 9:49 Richard Yao
2013-06-09 9:46 Richard Yao
2013-06-09 9:44 Richard Yao
2013-06-09 9:44 Richard Yao
2013-06-09 8:32 Richard Yao
2013-06-09 7:45 Richard Yao
2013-06-09 6:43 Richard Yao
2013-06-06 3:36 Richard Yao
2013-06-03 23:49 Richard Yao
2013-06-03 23:35 Richard Yao
2013-06-03 23:35 Richard Yao
2013-06-03 23:35 Richard Yao
2013-06-03 23:35 Richard Yao
2013-06-03 23:35 Richard Yao
2013-06-03 23:35 Richard Yao
2013-01-01 16:53 Richard Yao
2012-11-22 22:20 [gentoo-commits] proj/genkernel:master " Richard Yao
2013-01-01 16:53 ` [gentoo-commits] proj/genkernel:ryao " Richard Yao
2012-11-22 22:20 Richard Yao
2012-11-11 17:04 [gentoo-commits] proj/genkernel:master " Richard Yao
2012-11-11 17:32 ` [gentoo-commits] proj/genkernel:ryao " Richard Yao
2012-11-05 18:30 Richard Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370785018.2ccc6fc53812d83e458a2e69afdf63cf0c9c449a.ryao@gentoo \
--to=ryao@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox