path: root/lib
diff options
authorAndriy Gapon <avg@FreeBSD.org>2017-09-22 08:13:09 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-09-22 08:13:09 +0000
commitbd021dbd51bac06b1719770df11301cc61e01158 (patch)
tree7ed25befb19f90b821caedf2161e05be13e217bb /lib
parent67effa3d26d4a6fbf1607e7150df05c159538060 (diff)
8502 illumos#7955 broke delegated datasets when libshare is not present
illumos/illumos-gate@1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da https://github.com/illumos/illumos-gate/commit/1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da https://www.illumos.org/issues/8502 The code in lib/libzfs/common/libzfs_mount.c already basically handles the case when libshare is not installed. We just need to not fail in zfs_init_libshare_impl. I tested this in lx and things work as expected. I also tested there trying to set sharenfs and sharesmb on the delegated dataset. Neither is allowed from within a zone. The spew of msgs from a native zone is not ZFS specific. I see the same spew simply running the share command. Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Yuri Pankov <yuripv@gmx.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Jerry Jelinek <jerry.jelinek@joyent.com>
Notes: svn path=/vendor/illumos/dist/; revision=323911
Diffstat (limited to 'lib')
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libzfs/common/libzfs_mount.c b/lib/libzfs/common/libzfs_mount.c
index 45b095f40a6f..9fd37825a31c 100644
--- a/lib/libzfs/common/libzfs_mount.c
+++ b/lib/libzfs/common/libzfs_mount.c
@@ -24,6 +24,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
+ * Copyright 2017 Joyent, Inc.
* Copyright 2017 RackTop Systems.
@@ -664,8 +665,14 @@ _zfs_init_libshare(void)
static int
zfs_init_libshare_impl(libzfs_handle_t *zhandle, int service, void *arg)
+ /*
+ * libshare is either not installed or we're in a branded zone. The
+ * rest of the wrapper functions around the libshare calls already
+ * handle NULL function pointers, but we don't want the callers of
+ * zfs_init_libshare() to fail prematurely if libshare is not available.
+ */
if (_sa_init == NULL)
- return (SA_CONFIG_ERR);
+ return (SA_OK);
* Attempt to refresh libshare. This is necessary if there was a cache