Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp8019imm; Tue, 10 Jul 2018 19:40:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf7wxMDFFn49sPkg4S7wAZu32qOItLeNw3hPd2uOPEK5v2Tc0TU8CJx8nLQJz+ubjQ1B0VB X-Received: by 2002:a17:902:1127:: with SMTP id d36-v6mr27295880pla.267.1531276811083; Tue, 10 Jul 2018 19:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531276811; cv=none; d=google.com; s=arc-20160816; b=tVpG8NSZdNS87H3HQKqHwk8BCTFPcMhwFMMKQHhjuGlXet7h0U3MTHHK8GZY6QonCq EaDFLTRozH5S5mK9LTSiXoGFK8qv35oTsHIB11A9S8VpelnLZPVw6GwFgtFeAU/4CsyX 8Mt2dqBBe//P56QT9fAp96xM91r23MbC5ET7M5jcRiBMWspxL1Mlv39HWq6wI6dgxkre sdlxXvawN+5J6w+BwqUonXqGXEQLsiUKX1wLY1WdCqjskI8T0Ff4s1+T63imFE37Kq1e zWVG8he83/XZwgpclLemUGWpjmUQIfw53ZcRlpubrcfi9A3RticOviF1Ir1vZOLMD046 37uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=YAVABbhF8XJRsBPihMY17bl9+o6JNutp1ggVaRvEsDY=; b=HA9nByf1mC5h/BaGEfwY4kXkCJ2+RFX1TkxTJW/xdfoYVEIeXpXcmSLzEnUVtQ3nCH ISSv2Q8w/6uHbXzvbEKM62tfCPWTxjYv7L4ZiRQ1ZloBZxnMN4kL6njAP8v4aenWzsdj ikTip4WVRm2DxS5oUsFN78sYs4miPtGYb454wG82yVEx4ONX6dSlgV52nvecGMdw+oLy lp3LwExUQ7dP4NVG1zAHqS2BWqfhJI30Bi4qOTOgEn+47ITPNfotk7hEmZsL/T8VrzKc YMyhxGwsH+dzmd5nhHucQNOdeXDBi4ov64Gz7X9uIdTI263Gj4tgKmqR5NQdH+1FbYuy UkTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=FylggPa3; 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 l30-v6si18082895plg.420.2018.07.10.19.39.53; Tue, 10 Jul 2018 19:40:11 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=FylggPa3; 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 S1732396AbeGKClT (ORCPT + 99 others); Tue, 10 Jul 2018 22:41:19 -0400 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 Received: by mail-io0-f195.google.com with SMTP id v26-v6so22252567iog.5; Tue, 10 Jul 2018 19:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YAVABbhF8XJRsBPihMY17bl9+o6JNutp1ggVaRvEsDY=; b=FylggPa3a2MH/JUFzORdExdelemLRHUREeYnhl3nowflxwl8UQigYMT7Jhf3YFsNMQ xElFg1G2wAGItOoiIyltEZyWmAcOA6cBAOJqbwvkuvYLD39x6cAXKrCTB1PGfYFnH+vB J9m/8UAPL9sahwHSQ3mMLSJtmSnH1+Zq/4QCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YAVABbhF8XJRsBPihMY17bl9+o6JNutp1ggVaRvEsDY=; b=tdhSShzUFMnks9ibjZg6yoHCg09J9qUyIXAFMZJyIne43qMg976Y87Jq260/DdMEFV +FichRLVIegmED54udiga+2pIxvVS+eNVXh61lsUVFfyKWuGuYBoPm1Jz9zJlXOlJAZc rFDUSxXGDT79jhpnIao9TvwV9QY9HPO5lTS5gjHvI86FFJ5RJMCORxI3PkO+aPON0zD9 sR/4POM3T3iEj+CWZB17LL2EEhkAO1hLkveltUA0J9OJUjuIgUHNxk39WkICMvGIliF2 tEzadaZANAvZSFK3b5FCc1JME6aJtLBf9wYGiIFba4iG0zfUiZiusSI+OFoLi5/6q7eF HxPQ== X-Gm-Message-State: AOUpUlHMoBK8ksEtGY5F126m4lbQYDCN4G0g5c+MuDVP3MdrjrkPho8B 35Elg7LKCZ/BWmYqqAcuDEkf17Bpic6Rv3GhvWU= X-Received: by 2002:a6b:274f:: with SMTP id n76-v6mr23999290ion.259.1531276758351; Tue, 10 Jul 2018 19:39:18 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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