Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2393223ybz; Sun, 26 Apr 2020 18:05:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIBQMdznbe155gz0AYd5TeZVt/PKC/TQJIU2lvZgdN/Sjs/ksNxnkeW8DxqNJmSxumL+nnt X-Received: by 2002:a17:906:6d90:: with SMTP id h16mr17118238ejt.117.1587949527594; Sun, 26 Apr 2020 18:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587949527; cv=none; d=google.com; s=arc-20160816; b=ktXkQAV/Zi1dIgI3Z19me3Ds0x9zhyQnF8lU4pgUUhfb94Q6hwVjnk9zpZ0SmYp91k tiLq+TRBHxbUpoZnwZxTQmD46TT+BusDLgFPnuRG81T0z83sia1rQa6qxyIr4eK0SKRV CSfcDvdrFw+V/nHD0+0727FkNqGtMHX4Q/YWlZH8oRgsOlPp0THEyVCFY7L6pNhx1f06 t9U8tK9DcnfenEPwKg1SxoM0YEQ/wbJ4saa9zNUYMfAYBry1iKd98PNfhUuEPY9l99m2 Miq6YzOc/4v3jATmIhFrA9ljQ3KmQeKc+cGMguNva8eecFMytOtwBDgV5QIQper2iCc2 cK4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ijRLlOpC5ltUvCS6V4w/8YeSkYOvAAgMAiVQ/jj/wD8=; b=qmrrGbVi9FaoagnT3/+DqSn1NFlUbQXDAX+jaXfWpq7PlGCySoEqkSh/fKK5Waxspc HCi3dHQmV2BEoGXdroZa5+f0WO/uSRQs6pXLytzgzjEVhpyyr+idSzywwXCERQcAZzYO 75ujhVBunKRxInGHQqlEHrxNy96nON0FJxhejbH7aaqsMka9Y64hRot/dokOkhjTTYly EJLHymTkWLkq+ZelAjyGEZBARkDB43FgVwSVeo1CMzP5jajMU6aNp5qGtmy2O/w8wFAs EGMs4xpJ/mLgqO8q9e3H68+WRkgupI8W1rkNLkdQED1rHfwHhEujkwp4PVL2qSqT6TGL H5Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si7229024edv.549.2020.04.26.18.04.53; Sun, 26 Apr 2020 18:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbgD0BEw (ORCPT + 99 others); Sun, 26 Apr 2020 21:04:52 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:44681 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgD0BEw (ORCPT ); Sun, 26 Apr 2020 21:04:52 -0400 Received: from dread.disaster.area (pa49-195-157-175.pa.nsw.optusnet.com.au [49.195.157.175]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 135283A48CB; Mon, 27 Apr 2020 11:04:45 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1jSsCS-0000xz-SL; Mon, 27 Apr 2020 11:04:44 +1000 Date: Mon, 27 Apr 2020 11:04:44 +1000 From: Dave Chinner To: Ritesh Harjani Cc: "Darrick J. Wong" , Matthew Wilcox , Eric Biggers , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, Alexander Viro , Christoph Hellwig , Jan Kara , tytso@mit.edu, "Aneesh Kumar K . V" , linux-ext4@vger.kernel.org Subject: Re: [PATCH 1/2] fibmap: Warn and return an error in case of block > INT_MAX Message-ID: <20200427010444.GF2040@dread.disaster.area> References: <20200424191739.GA217280@gmail.com> <20200424225425.6521D4C040@d06av22.portsmouth.uk.ibm.com> <20200424234058.GA29705@bombadil.infradead.org> <20200424234647.GX6749@magnolia> <20200425070335.B43334C046@d06av22.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200425070335.B43334C046@d06av22.portsmouth.uk.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=QIgWuTDL c=1 sm=1 tr=0 a=ONQRW0k9raierNYdzxQi9Q==:117 a=ONQRW0k9raierNYdzxQi9Q==:17 a=kj9zAlcOel0A:10 a=cl8xLZFz6L8A:10 a=7-415B0cAAAA:8 a=XPaiuk4yifFrNG777nsA:9 a=DN0oiWT_x0Zc_wvr:21 a=PPZh3J10_SXtonLC:21 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Apr 25, 2020 at 12:33:34PM +0530, Ritesh Harjani wrote: > > > On 4/25/20 5:16 AM, Darrick J. Wong wrote: > > On Fri, Apr 24, 2020 at 04:40:58PM -0700, Matthew Wilcox wrote: > > > On Sat, Apr 25, 2020 at 04:24:24AM +0530, Ritesh Harjani wrote: > > > > Ok, I see. > > > > Let me replace WARN() with below pr_warn() line then. If no objections, > > > > then will send this in a v2 with both patches combined as Darrick > > > > suggested. - (with Reviewed-by tags of Jan & Christoph). > > > > > > > > pr_warn("fibmap: this would truncate fibmap result\n"); > > > > > > We generally don't like userspace to be able to trigger kernel messages > > > on demand, so they can't swamp the logfiles. printk_ratelimited()? > > > > Or WARN_ON_ONCE... > > So, Eric was mentioning WARN_** are mostly for kernel side of bugs. > But this is mostly a API fault which affects user side and also to > warn the user about the possible truncation in the block fibmap > addr. > Also WARN_ON_ONCE, will be shown only once and won't be printed for > every other file for which block addr > INT_MAX. > > I think we could go with below. If ok, I could post this in v2. > > pr_warn_ratelimited("fibmap: would truncate fibmap result\n"); Please include the process ID, the superblock ID and the task name that is triggering this warning. Otherwise the administrator will have no clue what is generating it and so won't be able to fix it... Cheers, Dave. -- Dave Chinner david@fromorbit.com