[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200428072958.439AA11C04C@d06av25.portsmouth.uk.ibm.com>
Date: Tue, 28 Apr 2020 12:59:56 +0530
From: Ritesh Harjani <riteshh@...ux.ibm.com>
To: Dave Chinner <david@...morbit.com>
Cc: "Darrick J. Wong" <darrick.wong@...cle.com>,
Matthew Wilcox <willy@...radead.org>,
Eric Biggers <ebiggers@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-xfs@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
Christoph Hellwig <hch@...radead.org>,
Jan Kara <jack@...e.com>, tytso@....edu,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
linux-ext4@...r.kernel.org
Subject: Re: [PATCH 1/2] fibmap: Warn and return an error in case of block >
INT_MAX
On 4/27/20 6:34 AM, Dave Chinner wrote:
> 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...
>
Thanks for the suggestion. I will make it like below then.
Will send a v2 soon.
+ pr_warn_ratelimited("[%s/%d] FS (%s): would truncate fibmap result\n",
+ current->comm, task_pid_nr(current),
+ sb->s_id);
+
Powered by blists - more mailing lists