freebsd-nq/lib
Richard Yao 803884217f Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS
Since 0.7.0, zpool import would unconditionally block on udev for 30
seconds. This introduced a regression in initramfs environments that
lack udev (particularly mdev based environments), yet use a zfs userland
tools intended for the system that had been built against udev. Gentoo's
genkernel is the main example, although custom user initramfs
environments would be similarly impacted unless special builds of the
ZFS userland utilities were done for them.  Such environments already
have their own mechanisms for blocking until device nodes are ready
(such as genkernel's scandelay parameter), so it is unnecessary for
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 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 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 <igor@dilos.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Closes #9436
2019-10-11 09:52:48 -07:00
..
libavl OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libefi OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libicp OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libnvpair OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libshare OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libspl OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libtpool OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libunicode OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libuutil OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libzfs Reduce loaded range tree memory usage 2019-10-09 10:36:03 -07:00
libzfs_core OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libzpool Reduce loaded range tree memory usage 2019-10-09 10:36:03 -07:00
libzutil Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS 2019-10-11 09:52:48 -07:00
Makefile.am Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00