summaryrefslogtreecommitdiff
path: root/usr/src/lib/libzfs
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-11-21 12:34:54 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-11-21 12:34:54 +0000
commitde53b36c571e97a4fbff4241211ffe91ace1c684 (patch)
treecf75c45fb3638a334ab2e33dea465db72bcc507a /usr/src/lib/libzfs
parentb6ebeeac71aba19031ac94ed8f38ac1f180f5170 (diff)
parent6c6016e36550d1281cc80b26506a45d0d9bdb903 (diff)
downloadillumos-joyent-de53b36c571e97a4fbff4241211ffe91ace1c684.tar.gz
[illumos-gate merge]
commit 6c6016e36550d1281cc80b26506a45d0d9bdb903 7547 rmalloc(9f) should mention rmallocmap_wait(9f) commit 52892d1d2b839551e473726ed56248a5b5649dc3 7585 Clarify mac private properties must be strings commit d174594cd572c5bbd8ecd98580222fb60508bade 7592 acpi commands link against host libc commit fab9be40d6bb364713294f6f6c925ccc58bacb24 7594 ld -zaslr should accept Solaris-compatible values commit 1c9272b861cd640a8342f4407da026ed98615517 7570 tunable to allow zvol SCSI unmap to return on commit of txn to ZIL commit b001165b0c3b957ada8be2307cb7337d3ae15871 7544 power(9E) should refer to dev_ops(9S), not cb_ops(9S) commit 386be055703d6da0a32d56189e59e87f1608c761 7589 nfs(4): delegation should be changed to server_delegation commit 9c02c7edf62c061c8b4d3134fb190ea51af6f69f 7565 loader: report sector size and number of sectors in lsdev output for bios disks commit 2c601221f598e1c7737ee1128853af2a7be2acb2 7591 New "zloop" command for running ztest indefinitely commit ad2760acbd9c3b479bf632f05c6f03d89830799d 7571 non-present readonly numeric ZFS props do not have default value commit 4dd77f9e38ef05b39db128ff7608d926fd3218c6 7545 zdb should disable reference tracking commit 91e2a09f39b7b47ff919323f4118fab26e6641d8 7543 ::spa -h should show free space histogram for whole pool commit 09c9e6dc9b69d10b771bb87e01040ec320a0bfd3 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED commit 5e629e018f19831ddde0164b9e2714a09fc1f1eb 7546 usb_get_max_pkts_per_isoc_request(9F) thinks it is a different function
Diffstat (limited to 'usr/src/lib/libzfs')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c3
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h5
-rw-r--r--usr/src/lib/libzfs/common/libzfs_mount.c42
3 files changed, 21 insertions, 29 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index f4b26d4c8d..da80c41623 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
* Copyright (c) 2013 Martin Matuska. All rights reserved.
@@ -2046,6 +2046,7 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
if (zfs_prop_readonly(prop) &&
*source != NULL && (*source)[0] == '\0') {
*source = NULL;
+ return (-1);
}
break;
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index 043d8c4832..c99a8324df 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -23,7 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
*/
#ifndef _LIBZFS_IMPL_H
@@ -73,7 +73,6 @@ struct libzfs_handle {
int libzfs_printerr;
int libzfs_storeerr; /* stuff error messages into buffer */
void *libzfs_sharehdl; /* libshare handle */
- uint_t libzfs_shareflags;
boolean_t libzfs_mnttab_enable;
avl_tree_t libzfs_mnttab_cache;
int libzfs_pool_iter;
@@ -84,8 +83,6 @@ struct libzfs_handle {
boolean_t libzfs_cachedprops;
};
-#define ZFSSHARE_MISS 0x01 /* Didn't find entry in cache */
-
struct zfs_handle {
libzfs_handle_t *zfs_hdl;
zpool_handle_t *zpool_hdl;
diff --git a/usr/src/lib/libzfs/common/libzfs_mount.c b/usr/src/lib/libzfs/common/libzfs_mount.c
index 7828e28f03..d1419fb3a8 100644
--- a/usr/src/lib/libzfs/common/libzfs_mount.c
+++ b/usr/src/lib/libzfs/common/libzfs_mount.c
@@ -22,7 +22,7 @@
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
*/
@@ -658,35 +658,30 @@ _zfs_init_libshare(void)
int
zfs_init_libshare(libzfs_handle_t *zhandle, int service)
{
- int ret = SA_OK;
-
if (_sa_init == NULL)
- ret = SA_CONFIG_ERR;
+ return (SA_CONFIG_ERR);
- if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) {
- /*
- * We had a cache miss. Most likely it is a new ZFS
- * dataset that was just created. We want to make sure
- * so check timestamps to see if a different process
- * has updated any of the configuration. If there was
- * some non-ZFS change, we need to re-initialize the
- * internal cache.
- */
- zhandle->libzfs_shareflags &= ~ZFSSHARE_MISS;
- if (_sa_needs_refresh != NULL &&
- _sa_needs_refresh(zhandle->libzfs_sharehdl)) {
- zfs_uninit_libshare(zhandle);
- zhandle->libzfs_sharehdl = _sa_init(service);
- }
+ /*
+ * Attempt to refresh libshare. This is necessary if there was a cache
+ * miss for a new ZFS dataset that was just created, or if state of the
+ * sharetab file has changed since libshare was last initialized. We
+ * want to make sure so check timestamps to see if a different process
+ * has updated any of the configuration. If there was some non-ZFS
+ * change, we need to re-initialize the internal cache.
+ */
+ if (_sa_needs_refresh != NULL &&
+ _sa_needs_refresh(zhandle->libzfs_sharehdl)) {
+ zfs_uninit_libshare(zhandle);
+ zhandle->libzfs_sharehdl = _sa_init(service);
}
- if (ret == SA_OK && zhandle && zhandle->libzfs_sharehdl == NULL)
+ if (zhandle && zhandle->libzfs_sharehdl == NULL)
zhandle->libzfs_sharehdl = _sa_init(service);
- if (ret == SA_OK && zhandle->libzfs_sharehdl == NULL)
- ret = SA_NO_MEMORY;
+ if (zhandle->libzfs_sharehdl == NULL)
+ return (SA_NO_MEMORY);
- return (ret);
+ return (SA_OK);
}
/*
@@ -832,7 +827,6 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto)
zfs_get_name(zhp));
return (-1);
}
- hdl->libzfs_shareflags |= ZFSSHARE_MISS;
share = zfs_sa_find_share(hdl->libzfs_sharehdl,
mountpoint);
}