Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755524AbbFUVQR (ORCPT ); Sun, 21 Jun 2015 17:16:17 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:34185 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbbFUVQQ (ORCPT ); Sun, 21 Jun 2015 17:16:16 -0400 MIME-Version: 1.0 In-Reply-To: <20150621211213.GA18732@ZenIV.linux.org.uk> References: <20150415181406.GL889@ZenIV.linux.org.uk> <5538C66F.4050404@samsung.com> <20150621211213.GA18732@ZenIV.linux.org.uk> Date: Sun, 21 Jun 2015 14:16:15 -0700 X-Google-Sender-Auth: kaoa1y60tVjji2lW6VVUvImfY2o Message-ID: Subject: Re: [git pull] vfs part 2 From: Linus Torvalds To: Al Viro Cc: Andrey Ryabinin , Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 686 Lines: 19 On Sun, Jun 21, 2015 at 2:12 PM, Al Viro wrote: > + if (count > rsize) { > + WARN_ON(1); > + count = rsize; > + } So if we'd actually want to merge it with the warning, I'd prefer writing it as if (WARN_ON_ONCE(count > rsize)) count = size; because it's smaller and cannot spam your logs. WARN_ON_ONCE() will only _warn_ once, but it always returns the conditional for the warning, so the above does the right thing. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/