linux: libzfs: simplify module-loaded check

The short-path is now one access() call,
we always modprobe zfs (ZFS_MODULE_LOADING which doesn't use the libzfs
boolean parsing is gone),
and we use a simple inotify IN_CREATE loop with a timerfd timeout
rather than 10ms kernel-style polling

There's one substantial difference: ZFS_MODULE_TIMEOUT=-1
now means "never give up", rather than "wait 10 minutes"

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13330
This commit is contained in:
наб
2022-04-14 23:30:41 +02:00
committed by Brian Behlendorf
parent 89e81bc6ad
commit 38f4d99f76
4 changed files with 109 additions and 89 deletions
+17 -3
View File
@@ -736,7 +736,7 @@ Do note that any changes done with the
command will be undone if the share is ever unshared (like via a reboot).
.
.Sh ENVIRONMENT VARIABLES
.Bl -tag -width "ZFS_MOUNT_HELPER"
.Bl -tag -width "ZFS_MODULE_TIMEOUT"
.It Sy ZFS_MOUNT_HELPER
Cause
.Nm zfs Cm mount
@@ -744,14 +744,28 @@ to use
.Xr mount 8
to mount ZFS datasets.
This option is provided for backwards compatibility with older ZFS versions.
.El
.Bl -tag -width "ZFS_SET_PIPE_MAX"
.
.It Sy ZFS_SET_PIPE_MAX
Tells
.Nm zfs
to set the maximum pipe size for sends/recieves.
Disabled by default on Linux
due to an unfixed deadlock in Linux's pipe size handling code.
.
.\" Shared with zpool.8
.It Sy ZFS_MODULE_TIMEOUT
Time, in seconds, to wait for
.Pa /dev/zfs
to appear.
Defaults to
.Sy 10 ,
max
.Sy 600 Pq 10 minutes .
If
.Pf < Sy 0 ,
wait forever; if
.Sy 0 ,
don't wait.
.El
.
.Sh INTERFACE STABILITY
+14
View File
@@ -524,6 +524,20 @@ If
.Sy ZPOOL_SCRIPTS_ENABLED
is not set, it is assumed that the user is allowed to run
.Nm zpool Cm status Ns / Ns Cm iostat Fl c .
.\" Shared with zfs.8
.It Sy ZFS_MODULE_TIMEOUT
Time, in seconds, to wait for
.Pa /dev/zfs
to appear.
Defaults to
.Sy 10 ,
max
.Sy 600 Pq 10 minutes .
If
.Pf < Sy 0 ,
wait forever; if
.Sy 0 ,
don't wait.
.El
.
.Sh INTERFACE STABILITY