aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-09-13 10:17:14 +0000
committerAndriy Gapon <avg@FreeBSD.org>2017-09-13 10:17:14 +0000
commitb804e370547ee5026f0a97de1344454adf6c1759 (patch)
tree639625aed90ac102f9799279eab02ea067c351ad /lib
parent03ad5aa4c1f93b5b86c67c9db3cb7754da597a10 (diff)
downloadsrc-b804e370547ee5026f0a97de1344454adf6c1759.tar.gz
src-b804e370547ee5026f0a97de1344454adf6c1759.zip
8331 zfs_unshare returns wrong error code for smb unshare failure
illumos/illumos-gate@4f4378cc54b7deec3a35c529dc397dbdc325b4bb https://github.com/illumos/illumos-gate/commit/4f4378cc54b7deec3a35c529dc397dbdc325b4bb https://www.illumos.org/issues/8331 zfs_unshare returns EZFS_UNSHARENFSFAILED on error for all share types. Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Andrew Stormont <astormont@racktopsystems.com>
Notes
Notes: svn path=/vendor/illumos/dist/; revision=323523
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/common/libzfs_mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libzfs/common/libzfs_mount.c b/lib/libzfs/common/libzfs_mount.c
index dc98d1073fa2..45b095f40a6f 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 RackTop Systems.
*/
/*
@@ -91,7 +92,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **,
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 {
@@ -916,7 +917,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
if ((err = zfs_init_libshare_arg(hdl, SA_INIT_ONE_SHARE_FROM_NAME,
(void *)name)) != 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)));
}
@@ -927,12 +928,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
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));
}