Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2924622rdb; Wed, 4 Oct 2023 16:27:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5n5K3HJS8vnKGcB3MfmZtbk8QVt7nXR8/EJYmS59dKcXuaKEU7Qyy+MjxxWKsXDFEENaE X-Received: by 2002:a17:902:c381:b0:1c5:7aa1:3a52 with SMTP id g1-20020a170902c38100b001c57aa13a52mr3614613plg.2.1696462046701; Wed, 04 Oct 2023 16:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696462046; cv=none; d=google.com; s=arc-20160816; b=tCV8laF9zMtufKrO9duVKJTAWX3JXe2MoebheFFQeXzN0nryPOjhFPoe65Z2sedxUV 2JV4lzxcphEKLIsdSoeGLunmbK3qYhgzHKzh4V1pTmQiAfNZecDGAnOOMI15pe4o/0z9 Pmz6XqCltm5n8qAHUeMpKLL5m9fN3uKC/CzFvbbRUOk4xIFPG8gFK9pAwfFqezV6dtLy JPckyDxCkZwxIX9dcxANrgWZkL2EyPurQLmw1qa59Pqc8v8J1sr7Rh8DEmbyILcclRNK UUtLK8jimGPij3u1DbiS+PvOkMV5Yz7K09HUB4FlGkZCe218QgycnLNaxeY2hcKkpEgS I3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YYN3ei2EtbEC7S4HXRPXiiNWYnmcbWHzFz8b+ORcpPY=; fh=ZaK2vudNijy95H0GvyYVBWTmhTw8nJYwWXkLewFdkfY=; b=lQn9BAihZLeX5tNtjdNkCuqh5pJgXUr0k02sAFtkHNV7SpS3hspV7TmKTFy09lhw2j paYEjRSi9aCwNLPgU0mizpN6nYllTqkPWlbl2xwyGrAaXxa47NMw36uuHLPDlTw5lYzA mmhdAdkQa6LlaqIRmo3BGPib+rS8VdHI/WlhKaCmZKRDNT2AUfHK59yi5uvjXMg5ISJv juQzSJppv/AW8XfSYA/YhzVJjQIyHlRv6hHyfAI8SNrI+4t03Vh6qJ8uHz/affR5MdGn XUC7alKA611mk/ale9TERNoB9qcuICeJIt/dV0ZMQYnf6itWZNHAriyjHXvRnWtsDEZe ZVbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mjxgppsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id la6-20020a170902fa0600b001c0c4be62basi203377plb.617.2023.10.04.16.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 16:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mjxgppsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A0B0581DDBC2; Wed, 4 Oct 2023 16:27:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240762AbjJDX0X (ORCPT + 99 others); Wed, 4 Oct 2023 19:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233866AbjJDX0V (ORCPT ); Wed, 4 Oct 2023 19:26:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64ECAC9 for ; Wed, 4 Oct 2023 16:26:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8973C433C7; Wed, 4 Oct 2023 23:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696461978; bh=x42U3iy9flrgCAqJT8UpF1tyjAUqScY4VU/d4Aqd980=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mjxgppsdA5lqstSvuMiI+b8noAmOjk2cYb0FcYpfV5w4J76IvO18ArPv82SUBpTst ykhyYoD+cZArt2H72ylPSggAbpCfLPO2Az0ZtkyIvOBkHGzkfOKn3UY5553Z9e5tQ3 UF1hhRpJTi3G8k+L2dPswl/gEnPCb0NCX7GQdK/kiQ0Pv9L8HZ/HDW9BzBqfnFVF9W R8qS/YcP3uSIn4fnWZwWe/yrFqimAKRb+sSjxAyb/KNolDtVFHvTefgJ5nL30DPVBt 96nRdo9RdNcvC7yL0Dpb/xeFnl/2fQYOWNlLPDKC9buyG/fJ0Z7lCYKkHbi82Vr+ch AHQjux+A3k8Ng== Date: Wed, 4 Oct 2023 16:26:16 -0700 From: Jaegeuk Kim To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [PATCH] f2fs-tools: use proper address entry count for direct nodes Message-ID: References: <20231003230155.355807-1-daeho43@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003230155.355807-1-daeho43@gmail.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 16:27:01 -0700 (PDT) X-Spam-Level: ** On 10/03, Daeho Jeong wrote: > From: Daeho Jeong > > For direct nodes, we have to use DEF_ADDRS_PER_BLOCK. > > Signed-off-by: Daeho Jeong > --- > fsck/fsck.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fsck/fsck.c b/fsck/fsck.c > index 78ffdb6..56a7d31 100644 > --- a/fsck/fsck.c > +++ b/fsck/fsck.c > @@ -2894,7 +2894,7 @@ static void fsck_failed_reconnect_file_dnode(struct f2fs_sb_info *sbi, > fsck->chk.valid_blk_cnt--; > f2fs_clear_main_bitmap(sbi, ni.blk_addr); > > - for (i = 0; i < ADDRS_PER_BLOCK(&node->i); i++) { > + for (i = 0; i < DEF_ADDRS_PER_BLOCK; i++) { It seems we need to use the inode block passing by fsck_failed_reconnect_file(). > addr = le32_to_cpu(node->dn.addr[i]); > if (!addr) > continue; 3012 fsck->chk.valid_blk_cnt--; 3013 if (addr == NEW_ADDR) And, we also need to skip if addr == COMPRESS_ADDR here? 3014 continue; 3015 f2fs_clear_main_bitmap(sbi, addr); 3016 } > -- > 2.42.0.582.g8ccd20d70d-goog