From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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...