Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2928897rdb; Wed, 4 Oct 2023 16:38:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEx5D1BubhHy4asv2WGERWUA9CHVGHV74UoQqqablQSOnSWwVSIl5UlTKGKXtjWkn0ysMys X-Received: by 2002:a17:90b:1213:b0:279:12e4:eab6 with SMTP id gl19-20020a17090b121300b0027912e4eab6mr1651438pjb.7.1696462687905; Wed, 04 Oct 2023 16:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696462687; cv=none; d=google.com; s=arc-20160816; b=XkuIp9TnrF/LmBZMZeWZnVz14JkgNWranA7SjfkPV+MZqfNJfgXzVaLIBm9DhN/Rgb nevwrEj1j/ZijeGhAr+G0JN5gSk6Q1NwTth4EkAAeOsbLmO27hy/3jk4jw71OeLJ/7C2 VJnbOobdFZS5oewkcY18tEVdsnIn0vysEZqJQCaJud+N6kd14KHKl1oeT9IjUd5DdbJb i43IgZoFT98D8r8PJXE9stUlQ4Fl/OyP7k6JLWyzfhZyXgj3kEZ5XwL3660xU+ADJlMx 1XWndgAwA+VWbKcTnqeTxwiqJpzN5kL9Qm2RRw71cCgETCWkew3UxI+R5khf39xZJ32E K/Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fORUCfyg1OYLIckpVuIRlc6CrB2QtpkrB5qEQj0FaD0=; fh=IuWhY7lUs8mn5eodWQHdP5czjrMrErk6TQ15b+TtD1w=; b=UVst1nuxllMkICxJvzzEvvPe1RVZAbxgnYjDl5Pw5wcYgwu/bLC8FG1NAixUD840Nq getiTwmQBo3xahHNH3aF32MquBrr4UyOMH/kOvZfVIDFTJNs80xRkpuIlkXoOdD0be9r dmMe3nn4bOV7LIA3GFdmKO0O8b8mXVyUWJZZPHeXi2/j0OGGBSGKh96gkKSuDtjlgWtG 6kZLyXAI5K56LzEBqS04QXm6EePcJmmJOXXpAk/Ysw9J/r1dfRuPSCGCOwEypC7vXyX8 g+i/MQK8i9z4Q+KV9BTufEmSAGHS8zKlQuAadiEjH+1tWTPaR1eWlFnmlpo9k1S0ZQ1q YPUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P5RYohu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n21-20020a17090ac69500b00268414272cbsi2510787pjt.75.2023.10.04.16.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 16:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P5RYohu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8E7BD830D115; Wed, 4 Oct 2023 16:37:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233418AbjJDXhh (ORCPT + 99 others); Wed, 4 Oct 2023 19:37:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjJDXhg (ORCPT ); Wed, 4 Oct 2023 19:37:36 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3757C9 for ; Wed, 4 Oct 2023 16:37:32 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-4526b9404b0so1025222137.0 for ; Wed, 04 Oct 2023 16:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696462652; x=1697067452; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fORUCfyg1OYLIckpVuIRlc6CrB2QtpkrB5qEQj0FaD0=; b=P5RYohu26qFWpqCbuNeerkf0t4/jo2dTa9hFI7s6kjKdIENjZs4s3xgx3W75Fo+5xM km3AskQVc4pThi4WFBUqxxwdmjpljEI2rRlQ6tuDyGmrh4r3X4GRp0SJFsQgNXM7Jtzl LLAcrsmIlSQvU/DQpJtsg9llfvd31J30RBFYwAFnSu6J/ZmaqNeFzTroGDhQg0eIMGHC JzayCV/jC3uqQ3pck/HXiKSZnlFJWzHlLDDwxPDgH6Swste+iauPyt1zSDXU5u3/rgaM 2mPnIbeOaS1OK8W8DUfyrXAtIkHwLYyXKgA2JdbeF7x98Lf5iiEqNByzatZuJDfG5SQ5 r1bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696462652; x=1697067452; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fORUCfyg1OYLIckpVuIRlc6CrB2QtpkrB5qEQj0FaD0=; b=ApQL0Lv3xm40xFKu0FjklnnTcAmvtQjOBz3XQVQPDMyCQ9FJEB1bjCLuocaIYzZuSF 3laaeUhCSxMKei14blq5QKMtuC9auOT9QrGS7vYQv/6nPfODfZ/jOjRpRAEo6MpA8zJk hanUGLMFRmEGu2hinVQ1wbQJBRq/AyR/aGHz1Lvfniok4Hn79gLTyUZnmXHouh1sd+2o 2Ley5rI8HkIqKplsgpf0ZMXNA9uylBRaxqLFygnNFb+wEAESuQBIYtdRKFLfoFEIAjEa ibzLbZ60QoF1MjcnVn2aMwUtcJJMc9LR34LJJKAS1qVTe2rAM0R0Zc3jow1Nmg4MafXQ gvrw== X-Gm-Message-State: AOJu0Yy1r9E5N3KfGJ8KhvclzkIiFQARivlfNWiar4PTNf6kASJHLxg9 /FLgKsZXfDAIMJko5rad/vTz3QuMi6dpkW1089mnOTzB X-Received: by 2002:a05:6102:40b:b0:44d:42c4:f4bf with SMTP id d11-20020a056102040b00b0044d42c4f4bfmr557391vsq.10.1696462652097; Wed, 04 Oct 2023 16:37:32 -0700 (PDT) MIME-Version: 1.0 References: <20231003230155.355807-1-daeho43@gmail.com> In-Reply-To: From: Daeho Jeong Date: Wed, 4 Oct 2023 16:37:20 -0700 Message-ID: Subject: Re: [PATCH] f2fs-tools: use proper address entry count for direct nodes To: Jaegeuk Kim Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 16:37:57 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 4, 2023 at 4:26=E2=80=AFPM Jaegeuk Kim wro= te: > > 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(stru= ct f2fs_sb_info *sbi, > > fsck->chk.valid_blk_cnt--; > > f2fs_clear_main_bitmap(sbi, ni.blk_addr); > > > > - for (i =3D 0; i < ADDRS_PER_BLOCK(&node->i); i++) { > > + for (i =3D 0; i < DEF_ADDRS_PER_BLOCK; i++) { > > It seems we need to use the inode block passing by fsck_failed_reconnect_= file(). This function is for direct nodes. Is it correct to use inode block here? > > > addr =3D le32_to_cpu(node->dn.addr[i]); > > if (!addr) > > continue; > > 3012 fsck->chk.valid_blk_cnt--; > 3013 if (addr =3D=3D NEW_ADDR) > > And, we also need to skip if addr =3D=3D COMPRESS_ADDR here? > > 3014 continue; > 3015 f2fs_clear_main_bitmap(sbi, addr); > 3016 } > > > -- > > 2.42.0.582.g8ccd20d70d-goog