From owner-svn-src-stable-11@freebsd.org Fri Oct 13 09:06:58 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6903E42106; Fri, 13 Oct 2017 09:06:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B35FE7F379; Fri, 13 Oct 2017 09:06:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D96v80097139; Fri, 13 Oct 2017 09:06:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D96vKh097138; Fri, 13 Oct 2017 09:06:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130906.v9D96vKh097138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324584 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:06:59 -0000 Author: avg Date: Fri Oct 13 09:06:57 2017 New Revision: 324584 URL: https://svnweb.freebsd.org/changeset/base/324584 Log: MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure 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 Fri Oct 13 09:05:32 2017 (r324583) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 13 09:06:57 2017 (r324584) @@ -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 + * Copyright 2017 RackTop Systems. */ /* @@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, c zfs_share_proto_t); /* - * The share protocols table must be in the same order as the zfs_share_prot_t + * The share protocols table must be in the same order as the zfs_share_proto_t * enum in libzfs_impl.h */ typedef struct { @@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co /* make sure libshare initialized */ if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { free(mntpt); /* don't need the copy anymore */ - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } @@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co if (share != NULL) { err = zfs_sa_disable_share(share, proto_table[proto].p_name); if (err != SA_OK) { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, + proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"), name, _sa_errorstr(err))); } } else { - return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, + return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err, dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"), name)); }