]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Make zfs-share service resilient to stale exports
authorDon Brady <don.brady@delphix.com>
Fri, 9 Sep 2022 17:54:16 +0000 (11:54 -0600)
committerGitHub <noreply@github.com>
Fri, 9 Sep 2022 17:54:16 +0000 (10:54 -0700)
commitede037cda73675f42b1452187e8dd3438fafc220
treefaa6d73ad888591c98ffb9b962ca6d13c6feb695
parent60d995727a19104a2832d475f5c0861ffbae2c97
Make zfs-share service resilient to stale exports

The are a few cases where stale entries in /etc/exports.d/zfs.exports
will cause the nfs-server service to fail when starting up.

Since the nfs-server startup consumes /etc/exports.d/zfs.exports, the
zfs-share service (which rebuilds the list of zfs exports) should run
before the nfs-server service.

To make the zfs-share service resilient to stale exports, this change
truncates the zfs config file as part of the zfs share -a operation.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes #13775
12 files changed:
cmd/zfs/zfs_main.c
etc/systemd/system/zfs-share.service.in
include/libzfs.h
lib/libshare/libshare.c
lib/libshare/libshare_impl.h
lib/libshare/nfs.c
lib/libshare/nfs.h
lib/libshare/os/freebsd/nfs.c
lib/libshare/os/linux/nfs.c
lib/libspl/include/libshare.h
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_mount.c