Anton Blanchard 84fba5ec91 sched: Fix sched_getaffinity()
taskset on 2.6.34-rc3 fails on one of my ppc64 test boxes with
the following error:

  sched_getaffinity(0, 16, 0x10029650030) = -1 EINVAL (Invalid argument)

This box has 128 threads and 16 bytes is enough to cover it.

Commit cd3d8031eb4311e516329aee03c79a08333141f1 (sched:
sched_getaffinity(): Allow less than NR_CPUS length) is
comparing this 16 bytes agains nr_cpu_ids.

Fix it by comparing nr_cpu_ids to the number of bits in the
cpumask we pass in.

Signed-off-by: Anton Blanchard <anton@samba.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Sharyathi Nagesh <sharyath@in.ibm.com>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Russ Anderson <rja@sgi.com>
Cc: Mike Travis <travis@sgi.com>
LKML-Reference: <20100406070218.GM5594@kryten>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-06 10:01:35 +02:00
..
2009-09-21 14:29:21 +02:00
2010-03-03 14:07:57 -05:00
2009-06-24 00:02:38 -04:00
2010-03-24 16:31:19 -07:00
2010-03-30 17:15:38 +11:00
2009-09-18 09:48:52 -07:00
2009-06-16 19:47:48 -07:00
2009-12-14 23:55:34 +01:00
2009-07-24 10:53:29 +02:00
2009-01-14 18:09:02 +01:00
2010-03-12 15:52:40 -08:00
2010-02-10 17:47:17 -08:00
2010-03-06 11:26:32 -08:00
2010-04-02 20:06:40 +02:00
2009-12-09 10:03:07 +01:00
2010-04-06 10:01:35 +02:00
2010-03-06 11:26:33 -08:00
2010-03-12 15:52:32 -08:00
2010-03-12 15:52:32 -08:00
2010-03-12 15:53:10 -08:00
2010-02-18 14:30:18 -08:00
2009-12-22 14:10:37 -08:00
2010-03-06 11:26:23 -08:00
2009-09-23 18:13:10 -07:00
2010-01-21 13:40:18 +01:00
2009-06-18 13:03:55 -07:00