]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] FUTEX_WAKE_OP: enhanced error handling
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 7 Nov 2005 08:59:33 +0000 (00:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 7 Nov 2005 15:53:38 +0000 (07:53 -0800)
commite59d961955022a2e913b0960eb9b1513e0070c01
tree66e0a2bdf18e03c7dadba7c4c7b896533aa2e762
parentabbffc72d71b00344f57defc80e6d1b39c79cb57
[PATCH] FUTEX_WAKE_OP: enhanced error handling

The code for FUTEX_WAKE_OP calls an arch callback,
futex_atomic_op_inuser().  That callback can return an error code, but
currently the caller assumes any error is EFAULT, and will try various
things to resolve the fault before eventually giving up with EFAULT
(regardless of the original error code).  This is not a theoretical case -
arch callbacks currently return -ENOSYS if the opcode they are given is
bogus.

This patch alters the code to detect non-EFAULT errors and return them
directly to the user.

Of course, whether -ENOSYS is the correct return value for the bogus opcode
case, or whether EINVAL would be more appropriate is another question.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jamie Lokier <jamie@shareable.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/futex.c