Page MenuHomeFreeBSD

D27511.id80440.diff
No OneTemporary

D27511.id80440.diff

Index: sys/kern/kern_cpuset.c
===================================================================
--- sys/kern/kern_cpuset.c
+++ sys/kern/kern_cpuset.c
@@ -625,7 +625,7 @@
* empty as well as RDONLY flags.
*/
static int
-cpuset_testupdate(struct cpuset *set, cpuset_t *mask, int check_mask)
+cpuset_testupdate(struct cpuset *set, cpuset_t *mask, int augment_mask)
{
struct cpuset *nset;
cpuset_t newmask;
@@ -634,13 +634,14 @@
mtx_assert(&cpuset_lock, MA_OWNED);
if (set->cs_flags & CPU_SET_RDONLY)
return (EPERM);
- if (check_mask) {
- if (!CPU_OVERLAP(&set->cs_mask, mask))
- return (EDEADLK);
+ if (augment_mask) {
CPU_COPY(&set->cs_mask, &newmask);
CPU_AND(&newmask, mask);
} else
CPU_COPY(mask, &newmask);
+
+ if (CPU_EMPTY(&newmask))
+ return (EDEADLK);
error = 0;
LIST_FOREACH(nset, &set->cs_children, cs_siblings)
if ((error = cpuset_testupdate(nset, &newmask, 1)) != 0)
@@ -730,7 +731,7 @@
*/
static int
cpuset_testupdate_domain(struct cpuset *set, struct domainset *dset,
- struct domainset *orig, int *count, int check_mask)
+ struct domainset *orig, int *count, int augment_mask __unused)
{
struct cpuset *nset;
struct domainset *domain;
@@ -2008,6 +2009,10 @@
goto out;
}
}
+ if (CPU_EMPTY(mask)) {
+ error = EDEADLK;
+ goto out;
+ }
switch (level) {
case CPU_LEVEL_ROOT:
case CPU_LEVEL_CPUSET:
@@ -2262,6 +2267,10 @@
goto out;
}
}
+ if (DOMAINSET_EMPTY(mask)) {
+ error = EDEADLK;
+ goto out;
+ }
DOMAINSET_COPY(mask, &domain.ds_mask);
domain.ds_policy = policy;

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 9:15 AM (8 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16027720
Default Alt Text
D27511.id80440.diff (1 KB)

Event Timeline