]> git.proxmox.com Git - mirror_zfs.git/commit
Improve the handling of sharesmb,sharenfs properties
authorUmer Saleem <usaleem@ixsystems.com>
Tue, 5 Sep 2023 08:33:58 +0000 (13:33 +0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 Sep 2023 00:16:14 +0000 (17:16 -0700)
commitc63aabaf1c548248c8a5081f6014a472dc7c4570
tree8196d7ae46b2737bc1626191a466d24be3c48a13
parentbbac1d2977ec245ec063313c97ffc2356be07c20
Improve the handling of sharesmb,sharenfs properties

For sharesmb and sharenfs properties, the status of setting the
property is tied with whether we succeed to share the dataset or
not. In case sharing the dataset is not successful, this is
treated as overall failure of setting the property. In this case,
if we check the property after the failure, it is set to on.

This commit updates this behavior and the status of setting the
share properties is not returned as failure, when we fail to
share the dataset.

For sharenfs property, if access list is provided, the syntax
errors in access list/host adresses are not validated until after
setting the property during postfix phase while trying to
share the dataset. This is not correct, since the property has
already been set when we reach there.

Syntax errors in access list/host addresses are validated while
validating the property list, before setting the property and
failure is returned to user in this case when there are errors
in access list.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15240
cmd/zfs/zfs_main.c
lib/libshare/os/freebsd/nfs.c
lib/libshare/os/linux/nfs.c
lib/libzfs/libzfs_changelist.c