Re: [PATCH v3] futex: Remove requirement for lock_page in

From: Davidlohr Bueso
Date: Wed Jan 20 2016 - 15:21:14 EST

On Wed, 20 Jan 2016, Thomas Gleixner wrote:

On Wed, 20 Jan 2016, Davidlohr Bueso wrote:
On Tue, 19 Jan 2016, Bueso wrote:
> +
> + /* Should be impossible but lets be paranoid for now */
> + BUG_ON(inode->i_mapping != mapping);

Hmm, do we want to transform this into an if and do rcu unlock and then just
call BUG()? I't doesn't matter at this point _anyway_, but it would be the
thing to do, no?

The better solution is to err out gracefully.

if (WARN_ON_ONCE(inode->i_mapping != mapping) {
err = -EFAULT;
goto out;


Ok, Linus would probably like that as well. If we're going this way,
we also need to release inode reference, before the rcu unlock.