summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authornd150628 <none@none>2006-06-09 22:14:52 -0700
committernd150628 <none@none>2006-06-09 22:14:52 -0700
commitefc555eb20b21e4aca66189c795d3bbd77bd2aa5 (patch)
tree38561fb7b437cf01d4139586120e6868cc617ea0 /usr/src
parent524e558aae3e99de2bdab73592f925ea489fbe07 (diff)
downloadillumos-gate-efc555eb20b21e4aca66189c795d3bbd77bd2aa5.tar.gz
6385436 zfs set <property> returns an error, but still sets property value (fix build)
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zfs/zfs_main.c14
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c14
2 files changed, 13 insertions, 15 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index 0fba9046bd..4187d8b506 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -1636,9 +1636,19 @@ set_callback(zfs_handle_t *zhp, void *data)
}
}
- if (zfs_prop_set(zhp, cbp->cb_prop, cbp->cb_value) != 0)
+ if (zfs_prop_set(zhp, cbp->cb_prop, cbp->cb_value) != 0) {
+ switch (libzfs_errno(g_zfs)) {
+ case EZFS_MOUNTFAILED:
+ (void) fprintf(stderr, gettext("property may be set "
+ "but unable to remount filesystem\n"));
+ break;
+ case EZFS_SHAREFAILED:
+ (void) fprintf(stderr, gettext("property may be set "
+ "but unable to reshare filesystem\n"));
+ break;
+ }
return (1);
-
+ }
ret = 0;
error:
return (ret);
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 79252fa94c..9ff3a083be 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -995,20 +995,8 @@ zfs_prop_inherit(zfs_handle_t *zhp, zfs_prop_t prop)
return (zfs_standard_error(hdl, errno, errbuf));
} else {
- if ((ret = changelist_postfix(cl)) != 0) {
- /*
- * If we got an error then warn the user that the
- * property was changed but not remounted/reshared
- */
- if (ret != 0 && (prop == ZFS_PROP_MOUNTPOINT ||
- prop == ZFS_PROP_SHARENFS)) {
- zfs_error(dgettext(TEXT_DOMAIN,
- "property set but unable to %s "
- "filesystem"), prop == ZFS_PROP_MOUNTPOINT ?
- "remount":"reshare");
- }
+ if ((ret = changelist_postfix(cl)) != 0)
goto error;
- }
/*
* Refresh the statistics so the new property is reflected.