Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234299
b: refs/heads/master
c: c0c9ed1
h: refs/heads/master
i:
  234297: 2a9d7f3
  234295: 9ed37e9
v: v3
  • Loading branch information
Thomas Gleixner committed Mar 11, 2011
1 parent bad03df commit f5a2042
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fe8f545c6d753ead15e1f4919d39e8f9bb49629
refs/heads/master: c0c9ed15042ceac7c485813012a0a97316101b57
16 changes: 8 additions & 8 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
struct task_struct *task, int set_waiters)
{
int lock_taken, ret, ownerdied = 0;
u32 uval, newval, curval;
u32 uval, newval, curval, vpid = task_pid_vnr(task);

retry:
ret = lock_taken = 0;
Expand All @@ -684,7 +684,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
* (by doing a 0 -> TID atomic cmpxchg), while holding all
* the locks. It will most likely not succeed.
*/
newval = task_pid_vnr(task);
newval = vpid;
if (set_waiters)
newval |= FUTEX_WAITERS;

Expand All @@ -696,7 +696,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
/*
* Detect deadlocks.
*/
if ((unlikely((curval & FUTEX_TID_MASK) == task_pid_vnr(task))))
if ((unlikely((curval & FUTEX_TID_MASK) == vpid)))
return -EDEADLK;

/*
Expand All @@ -723,7 +723,7 @@ static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb,
*/
if (unlikely(ownerdied || !(curval & FUTEX_TID_MASK))) {
/* Keep the OWNER_DIED bit */
newval = (curval & ~FUTEX_TID_MASK) | task_pid_vnr(task);
newval = (curval & ~FUTEX_TID_MASK) | vpid;
ownerdied = 0;
lock_taken = 1;
}
Expand Down Expand Up @@ -2047,9 +2047,9 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
{
struct futex_hash_bucket *hb;
struct futex_q *this, *next;
u32 uval;
struct plist_head *head;
union futex_key key = FUTEX_KEY_INIT;
u32 uval, vpid = task_pid_vnr(current);
int ret;

retry:
Expand All @@ -2058,7 +2058,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
/*
* We release only a lock we actually own:
*/
if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current))
if ((uval & FUTEX_TID_MASK) != vpid)
return -EPERM;

ret = get_futex_key(uaddr, flags & FLAGS_SHARED, &key);
Expand All @@ -2074,7 +2074,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
* anyone else up:
*/
if (!(uval & FUTEX_OWNER_DIED))
uval = cmpxchg_futex_value_locked(uaddr, task_pid_vnr(current), 0);
uval = cmpxchg_futex_value_locked(uaddr, vpid, 0);


if (unlikely(uval == -EFAULT))
Expand All @@ -2083,7 +2083,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
* Rare case: we managed to release the lock atomically,
* no need to wake anyone else up:
*/
if (unlikely(uval == task_pid_vnr(current)))
if (unlikely(uval == vpid))
goto out_unlock;

/*
Expand Down

0 comments on commit f5a2042

Please sign in to comment.