Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp36122pxb; Tue, 12 Apr 2022 16:05:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2QQCDcdg2W7G2mQvvXq8fPXKFyzRHpVhoWwzab6N4xmfW7A6mYvYPBZRu6TTlvUUSn/o/ X-Received: by 2002:a17:902:f60c:b0:156:82c9:e44b with SMTP id n12-20020a170902f60c00b0015682c9e44bmr39800965plg.106.1649804737618; Tue, 12 Apr 2022 16:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649804737; cv=none; d=google.com; s=arc-20160816; b=ouxboZ7qutVXAjzrlFsm+64EmnskM1Fj3OIl4VhrlZCfJyc0KddHXMtE0JFYZ4sDDl B91/iuXOZ1ApdVWk8IAu4qR3p5rPcU/up/BJ5bt9CPlHzlcg17DnpHsjZ0MVCCqoqRDl 4s0jcpjK6T3EBxpYMSU1tUzTLWGE4mmXefYBAnQ0he9AGNZp+g2RhnqCBfMCqeKssN3M +l923/pye6G9hdoiLDTiaAmegHJ7M8IlWsEP1U22UwWv2gC6oxBmovwGYV3E6PgM7ZV7 vGvxurLBrg2eMY3tKE7L3TfIP9W7whsgCSuYu/zdmLPxkps09//mXqJPB7MS1WehTZ4D xhbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IwUrIJEU98WEv61+EHwnggzRRFTPCUi5XxcGjNxx670=; b=UwkOwxi1UhN2kLyPmfVODiNfqzp9ofk/s7mXujmrMNgrhWb6lvXwnp4VSPGlAxSrM5 q+qFSUpofjeEhrzm5yY5jY6MTKSYZC+yihnFsqY0nCY29q/oNo7HFchfG98CdTx606Pa t4J4rItPjMIdiOJoizFcpb6EUW/vYLHNtr8XkdnFECmD7AklVRb2AtvxHVMHGKeT17bT OhMwyQmDVijZfrwObdycXnpgYi8YIGdUhESgu1OKWkiLCuwrcSFxYI5jXtuO4wTHuOwo aCFOONZ+a1+LgWSQC24nwe8MAV5Jheq89mSPG08PYGw+J9xUGxqvkBI+z4XTdpi1Irpz sZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TXNmTKxd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y4-20020a170902ed4400b00153b2d16595si12320928plb.413.2022.04.12.16.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:05:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TXNmTKxd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 194511EFE3A; Tue, 12 Apr 2022 14:48:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238782AbiDIDsm (ORCPT + 99 others); Fri, 8 Apr 2022 23:48:42 -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 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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);