From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [git pull] vfs part 2 Date: Sun, 21 Jun 2015 22:35:28 +0100 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 Cc: Andrey Ryabinin , Linux Kernel Mailing List , linux-fsdevel To: Linus Torvalds Return-path: 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 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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-fsdevel" in