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 AF372C636D4 for ; Mon, 13 Feb 2023 17:48:22 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pRcw9-0006rV-Bv; Mon, 13 Feb 2023 17:48:20 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pRcw8-0006rO-7S for linux-f2fs-devel@lists.sourceforge.net; Mon, 13 Feb 2023 17:48:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: 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=HlrjjGA2cMxW6mCCU5OcAOJpFnuuYf51QfOggTFO+rA=; b=PC4ERBBWE84VAAerUcIHfKf6Po FXYdLQ6TV9Wq6Y2qqlzY6RAXNYFE6TIbqVlw0lWLEH1hgIMHhFkGCuXoOhTYPXH9WT5m6HhQw/CVz hIGoL2rscUtAVYS9XRksAfVwwIZ+DTnNzidSylyOuPgiCljFWV6jcu/DXSaTdYNvQo0E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=HlrjjGA2cMxW6mCCU5OcAOJpFnuuYf51QfOggTFO+rA=; b=BiRP0BmspnNIBfCqysWL76n7gX H/bA45D6A1pcmE0i40xalHBKIJDjLbVn+Tg1M45+XoLMolUPNNK0YOGQFKbJP+Bf8yZv7fSG3dgNC NPfArawC/47UjOYdtYECqs+0GOk7mcKBu2MEWzZwJo4urVp+3+KPiKKq/VRfZXQy1CZk=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pRcw4-0008HF-Bu for linux-f2fs-devel@lists.sourceforge.net; Mon, 13 Feb 2023 17:48:19 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 336026121A for ; Mon, 13 Feb 2023 17:48:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FBC3C433D2; Mon, 13 Feb 2023 17:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676310489; bh=s+Zu2f5zVc4BKI5uEdJvxc75sJaut41fE2PEiEwMQPU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BY2V18kbSV/8VrBUAv8ODCkRkxV4Fbnn0cyNFbdy7AOFu6lXaDCQ70kvOP7R0bW/U O2klCsErKlEbR+M7DeYt0R8R5izo3mb1IuHfXmxDNuCRPqaZdy+C/hGHWawQQ5Hgxx UTC2Rk8w37iuaxG+Rrzy89lffIx/sT1+YmcNPaYMTNzFj1q4V+dGs9uwyRXI7eh5nb uC55xhTsVBPKjYyk8E9ULVyc437Opzh9z+sTnVc4QJm/6Oz+bJtIiKrRKs9MZyCXjr sw4JzAS8uVU2RHL+EuwfUb765CPb1kR7wCSTU0nWXM7rDVSlDZPE5bn9xgViwNG70Y W9g7jrl4XiGdg== Date: Mon, 13 Feb 2023 09:48:07 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20230210213250.3471246-1-jaegeuk@kernel.org> <1a66e32b-efc0-626b-b585-7f2bfac506a7@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1a66e32b-efc0-626b-b585-7f2bfac506a7@kernel.org> X-Headers-End: 1pRcw4-0008HF-Bu Subject: Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count 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: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 02/13, Chao Yu wrote: > On 2023/2/11 5:32, Jaegeuk Kim wrote: > > MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata. > > Good catch! > > Could you please add fixes line? It seems this is not a bug case, and exisits from the first F2FS patch. :) > > Thanks, > > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/segment.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h > > index 8ee5e5db9287..6003fbaf4b7d 100644 > > --- a/fs/f2fs/segment.h > > +++ b/fs/f2fs/segment.h > > @@ -720,7 +720,7 @@ static inline unsigned char curseg_alloc_type(struct f2fs_sb_info *sbi, > > static inline void check_seg_range(struct f2fs_sb_info *sbi, unsigned int segno) > > { > > - f2fs_bug_on(sbi, segno > TOTAL_SEGS(sbi) - 1); > > + f2fs_bug_on(sbi, segno > MAIN_SEGS(sbi) - 1); > > } > > static inline void verify_fio_blkaddr(struct f2fs_io_info *fio) > > @@ -775,7 +775,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, > > /* check segment usage, and check boundary of a given segment number */ > > if (unlikely(GET_SIT_VBLOCKS(raw_sit) > usable_blks_per_seg > > - || segno > TOTAL_SEGS(sbi) - 1)) { > > + || segno > MAIN_SEGS(sbi) - 1)) { > > f2fs_err(sbi, "Wrong valid blocks %d or segno %u", > > GET_SIT_VBLOCKS(raw_sit), segno); > > set_sbi_flag(sbi, SBI_NEED_FSCK); _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel