summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/rctl.c
diff options
context:
space:
mode:
authorsl108498 <none@none>2006-12-14 15:46:12 -0800
committersl108498 <none@none>2006-12-14 15:46:12 -0800
commitc1c0ebd597fd6db650197255bc1248c9f60afad8 (patch)
tree506d32f0a6e810933d277fae2b2741c032abe105 /usr/src/uts/common/os/rctl.c
parent16bd72582c60c40e83c55713078d05a462655a73 (diff)
downloadillumos-joyent-c1c0ebd597fd6db650197255bc1248c9f60afad8.tar.gz
6354498 rctl_local_replace_cb needs to remove new value when deletion fails
6504130 pool service not enabled when zone with tmp pool not booted before reboot 6504424 halting zones in parallel can fail, unable to unconfigure network interfaces
Diffstat (limited to 'usr/src/uts/common/os/rctl.c')
-rw-r--r--usr/src/uts/common/os/rctl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/src/uts/common/os/rctl.c b/usr/src/uts/common/os/rctl.c
index c0479005ea..026d6b13ed 100644
--- a/usr/src/uts/common/os/rctl.c
+++ b/usr/src/uts/common/os/rctl.c
@@ -1693,6 +1693,17 @@ rctl_local_replace_cb(rctl_hndl_t hndl, struct proc *p, rctl_entity_p_t *e,
rctl_t *rctl, rctl_val_t *oval, rctl_val_t *nval)
{
int ret;
+ rctl_val_t *tmp;
+
+ /* Verify that old will be delete-able */
+ tmp = rctl_val_list_find(&rctl->rc_values, oval);
+ if (tmp == NULL)
+ return (ESRCH);
+ /*
+ * Caller should verify that value being deleted is not the
+ * system value.
+ */
+ ASSERT(tmp->rcv_privilege != RCPRIV_SYSTEM);
/*
* rctl_local_insert_cb() does the job of flagging an error
@@ -1706,7 +1717,9 @@ rctl_local_replace_cb(rctl_hndl_t hndl, struct proc *p, rctl_entity_p_t *e,
if (ret = rctl_local_insert_cb(hndl, p, e, rctl, NULL, nval))
return (ret);
- return (rctl_local_delete_cb(hndl, p, e, rctl, NULL, oval));
+ ret = rctl_local_delete_cb(hndl, p, e, rctl, NULL, oval);
+ ASSERT(ret == 0);
+ return (0);
}
/*