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); 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A01A5C433EF for ; Sat, 9 Apr 2022 03:46:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nd23j-0004MN-1y; Sat, 09 Apr 2022 03:46:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nd23h-0004MG-Nh for linux-f2fs-devel@lists.sourceforge.net; Sat, 09 Apr 2022 03:46:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IwUrIJEU98WEv61+EHwnggzRRFTPCUi5XxcGjNxx670=; b=MlRhaW9hBJN3s1cC1RFIINhU+W 3jMjmrQOwS8GK4e56jqVjRl/EGkCegKYppKwwLF44VCvQzZk6krzWCNaQKnNhKPFkKtwcx0CO7eJC MMoIKIfaeV7EjNx8w3ofHMGeA2OOl6eSCTkYTYhoLHI8XdR2MZh8pZqm/om9VIRUiPfk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IwUrIJEU98WEv61+EHwnggzRRFTPCUi5XxcGjNxx670=; b=VGl52pu2UvaYU9PnsIl2hi+4J3 95u7qf1TN94SzRL7UGqjXRXe03maxvddGKGzK+9zkdYe1WXxARCu8Iec3fb3UvO1KxUnfQa/YpIeG oy3uTxi4DrHIfl23FSMNLwliUdsyPiixp/TbIWotxyJCE7gcUE+Xa9q2Xk4+hUFnpRL0=; Received: from ams.source.kernel.org ([145.40.68.75]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nd23g-00ANhH-TN for linux-f2fs-devel@lists.sourceforge.net; Sat, 09 Apr 2022 03:46:46 +0000 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 964EDB82E43; 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 Content-Language: en-US To: Dongliang Mu References: <20220408052207.209856-1-dzm91@hust.edu.cn> From: Chao Yu In-Reply-To: X-Headers-End: 1nd23g-00ANhH-TN Subject: Re: [f2fs-dev] [PATCH] fs: f2fs: remove WARN_ON in f2fs_is_valid_blkaddr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim , Dongliang Mu , linux-kernel , syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com, linux-f2fs-devel@lists.sourceforge.net Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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); _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel