[Patch 3/4] cpusets remove useless validation check

From: Paul Jackson
Date: Sat Sep 11 2004 - 03:33:47 EST


As reported to me by Simon Derr, there was an off by one
error in checking the usage count in validate_change().
However, after realizing that there was no way to exploit
this error, I determined that the check (for an empty
cpuset) could never fail here. This is because:
1) other code ensures we only attach a task to non-empty
cpusets, and
2) there is no way to make a non-empty cpuset empty again.

So, rather than fix the useless check, just remove it.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

Index: 2.6.9-rc1-mm4/kernel/cpuset.c
===================================================================
--- 2.6.9-rc1-mm4.orig/kernel/cpuset.c 2004-09-08 18:44:33.000000000 -0700
+++ 2.6.9-rc1-mm4/kernel/cpuset.c 2004-09-08 18:45:40.000000000 -0700
@@ -501,14 +501,6 @@ static int validate_change(const struct
if (cur == &top_cpuset)
return -EPERM;

- /* Any in-use cpuset must have at least ONE cpu and mem */
- if (atomic_read(&trial->count) > 1) {
- if (cpus_empty(trial->cpus_allowed))
- return -ENOSPC;
- if (nodes_empty(trial->mems_allowed))
- return -ENOSPC;
- }
-
/* We must be a subset of our parent cpuset */
if (!is_cpuset_subset(trial, par))
return -EACCES;

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/