From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f195.google.com ([209.85.223.195]:37931 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732277AbeGKClS (ORCPT ); Tue, 10 Jul 2018 22:41:18 -0400 MIME-Version: 1.0 References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> <20180711022206.12571-8-viro@ZenIV.linux.org.uk> In-Reply-To: <20180711022206.12571-8-viro@ZenIV.linux.org.uk> From: Linus Torvalds Date: Tue, 10 Jul 2018 19:39:07 -0700 Message-ID: Subject: Re: [RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error To: Al Viro Cc: linux-fsdevel , Linux Kernel Mailing List , Miklos Szeredi Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. Linus