X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=kernel%2Ffutex.c;h=5efa2f978032d1f20955c5f99eb24bf0e1051c51;hb=b28485acb930f67c014024bc3b9c01129124e566;hp=5872e3507f356bc61c71fa65c7e58d7866df316c;hpb=cc3327e7dfc16a9a3e164075234c869867a59e45;p=linux-2.6-omap-h63xx.git diff --git a/kernel/futex.c b/kernel/futex.c index 5872e3507f3..5efa2f97803 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -270,7 +270,13 @@ static void wake_futex(struct futex_q *q) /* * The waiting task can free the futex_q as soon as this is written, * without taking any locks. This must come last. + * + * A memory barrier is required here to prevent the following store + * to lock_ptr from getting ahead of the wakeup. Clearing the lock + * at the end of wake_up_all() does not prevent this store from + * moving. */ + wmb(); q->lock_ptr = NULL; } @@ -350,6 +356,13 @@ retry: if (bh1 != bh2) spin_unlock(&bh2->lock); +#ifndef CONFIG_MMU + /* we don't get EFAULT from MMU faults if we don't have an MMU, + * but we might get them from range checking */ + ret = op_ret; + goto out; +#endif + if (unlikely(op_ret != -EFAULT)) { ret = op_ret; goto out;