Skip to content

Commit

Permalink
futex: Replace pointless printk in fixup_owner()
Browse files Browse the repository at this point in the history
If that unexpected case of inconsistent arguments ever happens then the
futex state is left completely inconsistent and the printk is not really
helpful. Replace it with a warning and make the state consistent.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: [email protected]
  • Loading branch information
KAGA-KOKO committed Jan 26, 2021
1 parent 12bb3f7 commit 04b79c5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2550,14 +2550,10 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked)

/*
* Paranoia check. If we did not take the lock, then we should not be
* the owner of the rt_mutex.
* the owner of the rt_mutex. Warn and establish consistent state.
*/
if (rt_mutex_owner(&q->pi_state->pi_mutex) == current) {
printk(KERN_ERR "fixup_owner: ret = %d pi-mutex: %p "
"pi-state %p\n", ret,
q->pi_state->pi_mutex.owner,
q->pi_state->owner);
}
if (WARN_ON_ONCE(rt_mutex_owner(&q->pi_state->pi_mutex) == current))
return fixup_pi_state_owner(uaddr, q, current);

return 0;
}
Expand Down

0 comments on commit 04b79c5

Please sign in to comment.