diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-09-28 20:59:58 -0700 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@mandrakesoft.com> | 2002-09-28 20:59:58 -0700 |
| commit | aa016b08aa911f67f582e242e8415d01f29c86a8 (patch) | |
| tree | 9a5bbb132462c52279f86d44ea8e617cbebe90f1 /kernel | |
| parent | 6e21ad7b3e61e9b4659e2c9a57a4f49b7d655601 (diff) | |
[PATCH] futex-fix-2.5.39-A1
This fixes one more race left in the new futex hashing code, which
triggers if a futex waiter gets a signal after it has been woken up but
before it actually wakes up.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/futex.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 4b460d628f5a..f11d71ab5717 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -151,13 +151,13 @@ static void futex_vcache_callback(vcache_t *vcache, struct page *new_page) struct futex_q *q = container_of(vcache, struct futex_q, vcache); struct list_head *head = hash_futex(new_page, q->offset); - BUG_ON(list_empty(&q->list)); - spin_lock(&futex_lock); - q->page = new_page; - list_del_init(&q->list); - list_add_tail(&q->list, head); + if (!list_empty(&q->list)) { + q->page = new_page; + list_del(&q->list); + list_add_tail(&q->list, head); + } spin_unlock(&futex_lock); } |
