A small cleanup that allows for fixup_pi_state_owner() only to be called from fixup_owner(), and make requeue_pi uniformly call fixup_owner() regardless of the state in which the fixup is actually needed. Of course this makes the caller's first pi_state->owner != current check redundant, but that should't really matter.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -3241,15 +3241,14 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, · 3240 unmodified lines | ||
| 3241 | 3241 | * reference count. |
| 3242 | 3242 | */ |
| 3243 | 3243 | |
| 3244 | − /* Check if the requeue code acquired the second futex for us. */ | |
| 3244 | + /* | |
| 3245 | + * Check if the requeue code acquired the second futex for us and do | |
| 3246 | + * any pertinent fixup. | |
| 3247 | + */ | |
| 3245 | 3248 | if (!q.rt_waiter) { |
| 3246 | − /* | |
| 3247 | − * Got the lock. We might not be the anticipated owner if we | |
| 3248 | − * did a lock-steal - fix up the PI-state in that case. | |
| 3249 | − */ | |
| 3250 | 3249 | if (q.pi_state && (q.pi_state->owner != current)) { |
| 3251 | 3250 | spin_lock(q.lock_ptr); |
| 3252 | − ret = fixup_pi_state_owner(uaddr2, &q, current); | |
| 3251 | + ret = fixup_owner(uaddr2, &q, true); | |
| 3253 | 3252 | /* |
| 3254 | 3253 | * Drop the reference to the pi state which |
| 3255 | 3254 | * the requeue_pi() code acquired for us. |