HomeFreeBSD

mount: use the mount syscall directly

Description

mount: use the mount syscall directly

Allow zfs datasets to be mounted on Linux without relying on the
invocation of an external processes. This is the same behavior
which is implemented for FreeBSD.

Use of the libmount library was originally considered because it
provides functionality to properly lock and update the /etc/mtab
file. However, these days /etc/mtab is typically a symlink to
/proc/self/mounts so there's nothing to updated. Therefore, we
call mount(2) directly and avoid any additional dependencies.

If required the legacy behavior can be enabled by setting the
ZFS_MOUNT_HELPER environment variable. This may be needed in
environments where SELinux in enabled and the zfs binary does
not have mount permission.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Felix Dörre <felix@dogcraft.de>
#10294

Details

Provenance
felixdoerre <felixdoerre@users.noreply.github.com>Authored on May 21 2020, 1:02 AM
GitHub <noreply@github.com>Committed on May 21 2020, 1:02 AM
Parents
rG57434abae6af: Use boot_ncpus in place of max_ncpus in taskq_create
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG501a1511aeaa: mount: use the mount syscall directly (authored by felixdoerre <felixdoerre@users.noreply.github.com>).May 21 2020, 1:02 AM