Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755753AbbFUVfp (ORCPT ); Sun, 21 Jun 2015 17:35:45 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:37157 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbbFUVfe (ORCPT ); Sun, 21 Jun 2015 17:35:34 -0400 Date: Sun, 21 Jun 2015 22:35:28 +0100 From: Al Viro To: Linus Torvalds Cc: Andrey Ryabinin , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] vfs part 2 Message-ID: <20150621213528.GP17109@ZenIV.linux.org.uk> References: <20150415181406.GL889@ZenIV.linux.org.uk> <5538C66F.4050404@samsung.com> <20150621211213.GA18732@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.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 24 On Sun, Jun 21, 2015 at 02:16:15PM -0700, Linus Torvalds wrote: > 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. Sure, but I would really like to verify that this _is_ what's going on there. This is just a "please try that on your reproducer to make sure that it's not something entirely different", thus the lack of S-o-b, etc. For the final variant (and we definitely should cope with BS from server) we probably want to use p9_debug() instead of WARN_ON/WARN_ON_ONCE. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/