From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F0A8C433EF for ; Sat, 9 Apr 2022 03:46:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238963AbiDIDsr (ORCPT ); Fri, 8 Apr 2022 23:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231553AbiDIDsh (ORCPT ); Fri, 8 Apr 2022 23:48:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA8A138BF4 for ; Fri, 8 Apr 2022 20:46:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6CCE7B82BFA for ; Sat, 9 Apr 2022 03:46:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FF7DC385A4; Sat, 9 Apr 2022 03:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649475989; bh=Ayb5hOX+i0FYgvnXG3e1nz3NSgrfl8nSbqPlfEV1NhA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TXNmTKxdaftbGYQMVbAiJH2mRxMbkP5glhSOccafVmsDCxPowFIweppa8qoKJOdez Ep4e3+dW4L5f+Xi9QhRTfg0zRymursmVLlBlPeQgfIzt23UyVO7hPzAoR1p/FK0+XD CnLAamE4Dxnr/Vz2kaQvKTKQAdeTejWzDBB36V9AhpbuJCPm870etSUggDWbJ+E8MG U7mB8HqhWrdCoK5uExhJL/Nk0REPEw0zPDWPSMmm9jC6QGnAq30QZIpHr5Nml6lYjr LcYFkOIEXoC1UtjFOhUto0fkP0M/bG+WgG/YJHRNrVflme49SrISGpOZ44nNn0C7m1 /ti9U6AhhefuQ== Message-ID: <7e896205-027d-32e2-32b5-8951231132ac@kernel.org> Date: Sat, 9 Apr 2022 11:46:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] fs: f2fs: remove WARN_ON in f2fs_is_valid_blkaddr Content-Language: en-US To: Dongliang Mu Cc: Dongliang Mu , Jaegeuk Kim , syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel References: <20220408052207.209856-1-dzm91@hust.edu.cn> From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/4/9 9:34, Dongliang Mu wrote: > On Sat, Apr 9, 2022 at 8:27 AM Chao Yu wrote: >> >> On 2022/4/8 13:22, Dongliang Mu wrote: >>> From: Dongliang Mu >>> >>> In f2fs_is_valid_blkaddr, if type is DATA_GENERIC_ENHANCE or >>> DATA_GENERIC_ENHANCE_READ, it invokes WARN_ON(1) not matter >>> blkaddr is in the range or not. >> >> If we run into the path where we invoke WARN_ON(1) in f2fs_is_valid_blkaddr(), >> It means f2fs image may be broken, or there is a bug in f2fs. >> >> So, do you suffer any related issue in your environment? > > related issue? Can you explain a little? > > If you mean if this warning occurs, any other issues or crash I mean have you seen any warning info printed in the path of f2fs_is_valid_blkaddr() before applying this patch, and if so, w/ what reproducer? or you just figure out this patch from perspective of code review? Thanks, > behaviors are generated? I tested on the syzbot. After removing the > WARN_ON, there is no abnormal issue or crash behaviors followed with > the corresponding reproducer. > > >> >> Thanks, >> >>> >>> Fix this by removing WARN_ON. >>> >>> Note that, syzbot patch testing does not incur any further issues >>> >>> Reported-by: syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com >>> Signed-off-by: Dongliang Mu >>> --- >>> fs/f2fs/checkpoint.c | 2 -- >>> 1 file changed, 2 deletions(-) >>> >>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >>> index f5366feea82d..521498b2dd8c 100644 >>> --- a/fs/f2fs/checkpoint.c >>> +++ b/fs/f2fs/checkpoint.c >>> @@ -158,7 +158,6 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr, >>> f2fs_err(sbi, "Inconsistent error blkaddr:%u, sit bitmap:%d", >>> blkaddr, exist); >>> set_sbi_flag(sbi, SBI_NEED_FSCK); >>> - WARN_ON(1); >>> } >>> return exist; >>> } >>> @@ -196,7 +195,6 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, >>> f2fs_warn(sbi, "access invalid blkaddr:%u", >>> blkaddr); >>> set_sbi_flag(sbi, SBI_NEED_FSCK); >>> - WARN_ON(1); >>> return false; >>> } else { >>> return __is_bitmap_valid(sbi, blkaddr, type);