Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp10101imm; Tue, 10 Jul 2018 19:43:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeg6+8Ld6beUQ36osXaQtGY2+wJjd13ZT4iFd8OqAQSNlEqj4PAkSvJCYVUFe1hgf9QBcya X-Received: by 2002:a62:43c8:: with SMTP id l69-v6mr108583pfi.196.1531277029878; Tue, 10 Jul 2018 19:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531277029; cv=none; d=google.com; s=arc-20160816; b=TjpmiaajRUtnD/YOWZ4Ed5jGsuxq10FAfLoFY+VAgLTPuu4IGKtTkjaO9L0ALcz6H0 VYi31JeikPj6XwA80+EQfroaCUuWX10jK0bD5b4BBM+mwtkUELq0G0SoSJGKx+BE9b9s Fh66maISdrARykeL+ePEDOH0ipsJL81Q5KICZFu6WUH3DesS/7XzgoBNXMQvsb490rBw XSX0zmicMDsYsbalEV3to4Z7VjGj4XGuNRoyojeHspgieb8Urm+1S5ROCkZpK3/Kiii4 hqfmGkQRhdFB9JkrEGXKTfZElKt1u2g9X+qqjNObAC/ylBXnIAASBXJNY9cyZ/JG9qKE PryQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4+cvP6E/4SdbzSD4RMIGSZvCUbkfCy429gz7WwJVXhA=; b=UjdPW70oTQ1bVZiWrlxznznsdg862gp0ZE2pZzP9bYTIe97yp3+0eAqt/VqMKdu4mr iKxgoZ8MTeDhE3ybsx/8b4RVMp51HVwZMIuBYyT+G5JcvdpAVhDUEEN/LFXuIHW9ygPu I50tAoTS6cfhpj9HTddkdxZgzEDo+FZKyU5qvabiiqZ8uq5yi6Nl4hb7yzVKawL6mecb /ZfugybsJAF+6yzsfUfOmD833rHhQotpU+lL3FpMM/tY2Y4yP+0+u3U/jv9mx9luXP+7 g+mAZmzhDexhSfzHFgsNTHIZow2B3avDiy36abg+eiRmvhw9nHe6wq5pX+Ky8EpDvK40 /SMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si18232635plb.213.2018.07.10.19.43.34; Tue, 10 Jul 2018 19:43:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732415AbeGKCnh (ORCPT + 99 others); Tue, 10 Jul 2018 22:43:37 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47054 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732277AbeGKCnh (ORCPT ); Tue, 10 Jul 2018 22:43:37 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fd54R-0003pc-8i; Wed, 11 Jul 2018 02:41:35 +0000 Date: Wed, 11 Jul 2018 03:41:35 +0100 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel , Linux Kernel Mailing List , Miklos Szeredi Subject: Re: [RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error Message-ID: <20180711024135.GO30522@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> <20180711022206.12571-8-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 10, 2018 at 07:39:07PM -0700, Linus Torvalds wrote: > On Tue, Jul 10, 2018 at 7:23 PM Al Viro wrote: > > > > > > cleanup_all: > > + if (unlikely(error > 0)) { > > + WARN_ON(1); > > + error = -EINVAL; > > + } > > Can we please do this as > > if (WARN_ON_ONCE(error > 0)) > error = -EINVAL; > > > instead? > > That already should do the unlikely for you, and *if* somebody can > trigger this, at least they won't be spamming the logs and making a > mess. A single warning is fine. No problem, will do...