Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 23:38:03 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331381 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201803222338.w2MNc3Do089801@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar 22 23:38:03 2018
New Revision: 331381
URL: https://svnweb.freebsd.org/changeset/base/331381

Log:
  MFC r329505: MFV r323911:
  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>

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c	Thu Mar 22 23:34:48 2018	(r331380)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c	Thu Mar 22 23:38:03 2018	(r331381)
@@ -24,6 +24,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
+ * Copyright 2017 Joyent, Inc.
  * Copyright 2017 RackTop Systems.
  */
 
@@ -610,8 +611,14 @@ zfs_init_libshare(libzfs_handle_t *zhandle, int servic
 	int ret = SA_OK;
 
 #ifdef illumos
+	/*
+	 * 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)
-		ret = SA_CONFIG_ERR;
+		return (SA_OK);
 
 	if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) {
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803222338.w2MNc3Do089801>