Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1543854

Re: [PATCH -v4 02/10] futex: Add missing error handling to FUTEX_REQUEUE_PI

Path csiph.com!news.redatomik.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH -v4 02/10] futex: Add missing error handling to FUTEX_REQUEUE_PI
Date Sat, 17 Dec 2016 01:10:02 +0100
Message-ID <sPaJA-282-3@gated-at.bofh.it> (permalink)
References <sNRfX-7LI-3@gated-at.bofh.it> <sNRfY-7LI-35@gated-at.bofh.it>
X-Original-To Peter Zijlstra <peterz@infradead.org>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.7.1 (2016-10-04)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc tglx@linutronix.de, mingo@kernel.org, juri.lelli@arm.com, rostedt@goodmis.org, xlpang@redhat.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com
X-Original-Date Fri, 16 Dec 2016 16:06:39 -0800
X-Original-Message-ID <20161217000639.GE62123@f23x64.localdomain>
X-Original-References <20161213083638.938898295@infradead.org> <20161213085730.145521187@infradead.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1543854

Show key headers only | View raw


On Tue, Dec 13, 2016 at 09:36:40AM +0100, Peter Zijlstra wrote:
> Thomas spotted that fixup_pi_state_owner() can return errors and we
> fail to unlock the rt_mutex in that case.
> 

We handled this explicitly before Patch 1/10, so can this be rolled into 1/10
(er 9) as a single commit?

> Reported-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  kernel/futex.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -2896,6 +2896,8 @@ static int futex_wait_requeue_pi(u32 __u
>  		if (q.pi_state && (q.pi_state->owner != current)) {
>  			spin_lock(q.lock_ptr);
>  			ret = fixup_pi_state_owner(uaddr2, &q, current);
> +			if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current)
> +				rt_mutex_unlock(&q.pi_state->pi_mutex);
>  			/*
>  			 * Drop the reference to the pi state which
>  			 * the requeue_pi() code acquired for us.
> 
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -v4 02/10] futex: Add missing error handling to FUTEX_REQUEUE_PI Peter Zijlstra <peterz@infradead.org> - 2016-12-13 10:10 +0100
  Re: [PATCH -v4 02/10] futex: Add missing error handling to  FUTEX_REQUEUE_PI Darren Hart <dvhart@infradead.org> - 2016-12-17 01:10 +0100
    Re: [PATCH -v4 02/10] futex: Add missing error handling to  FUTEX_REQUEUE_PI Peter Zijlstra <peterz@infradead.org> - 2016-12-17 15:00 +0100
      Re: [PATCH -v4 02/10] futex: Add missing error handling to  FUTEX_REQUEUE_PI Darren Hart <dvhart@infradead.org> - 2016-12-19 00:40 +0100

csiph-web