From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758166AbcATUVK (ORCPT ); Wed, 20 Jan 2016 15:21:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:50890 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755351AbcATUVI (ORCPT ); Wed, 20 Jan 2016 15:21:08 -0500 Date: Wed, 20 Jan 2016 12:20:59 -0800 From: Davidlohr Bueso To: Thomas Gleixner Cc: Mel Gorman , Peter Zijlstra , Ingo Molnar , Sebastian Andrzej Siewior , Chris Mason , Darren Hart , linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH v3] futex: Remove requirement for lock_page in Message-ID: <20160120202059.GH27825@linux-uzut.site> References: <1453249853-1184-1-git-send-email-dave@stgolabs.net> <20160120195523.GF27825@linux-uzut.site> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> right >> thing to do, no? > >The better solution is to err out gracefully. > > if (WARN_ON_ONCE(inode->i_mapping != mapping) { > err = -EFAULT; > rcu_read_unlock(); > goto out; > } > >Hmm? 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. Thanks, Davidlohr