Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2576314rdg; Mon, 16 Oct 2023 08:26:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwv24MyquyVvk0qa3hAOpK5/FBu4JGjctYhr+y1rrznk6ttF5smr+VPxuu4pcs8rRnmV+9 X-Received: by 2002:aca:1b13:0:b0:3ae:2b43:dd4a with SMTP id b19-20020aca1b13000000b003ae2b43dd4amr35905743oib.45.1697469995403; Mon, 16 Oct 2023 08:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697469995; cv=none; d=google.com; s=arc-20160816; b=K+OQnnyCdQTMS8cfZOmOpE0Wy+6jA1q/WqK5gHb/JSzOZty3FayOf8vCTgixTKpKbI lDveztTGoOYXl21KWCrEDnJpLUJznTORztPplbj8NrG/TpZd4SEjoSWkJ2DqPiXISepb eWNZo/vGHyVmPvo2tqbzrI/bO/zK9JQ0hI5MaCAob6IkSDb6mSzrO5HVFqrVmiu1NgdL ydEXi6WL/iw8xVEOunlQbtQ4+UVZ1X3fScAIHOiRjK67Z4W4Vj99lQTv5Y2C/XITJOzP GNtRrmNrxM9MQGvJdyudPL7cdXP3HvAtoJ1iNg4ajM+/bO0RPYKNd9LMthor9GI1uoR4 wH9g== 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=VdJuKEfOYE5A8Kjx9jh0E3Zg2w1jYR6HPq2kjcrmS/0=; fh=sPilOYAT4QfMgYxGH2LjRrcqbLUzvrQqMQUicHZMufQ=; b=td04BjlWJR45qqqocD2lqCgE3151EMn8cxvhrV8pWdEKtmeDiU9QPczDIg54EiWEPk qvqEatxv2N9l3oiBjUbz5cRxPF0Os39lAsZgztW1fm6UltFh975BOuN9GPOi9V18shQh epvVKMjwo0JESd3y0pzVQSzj8AyLq0eHNWOBrsplwG94s6tm/bCd9vOPPL35/FOiw5up dBT37oXZrB5/IEoxnv/95sUWyQ3vmxg7h4wOnXlJixqQXrdx2xiMGlOX2Aoi4nYwyeLU alnhRhYLNLHByrkShp3184YCoBxqKTHBNFWgWTqT0L7bVL8K/69bnWaavBmR2ZL/A88V 67hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JcdSr72r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k3-20020a654643000000b00577448019b5si10893993pgr.276.2023.10.16.08.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JcdSr72r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 46AC880779A2; Mon, 16 Oct 2023 08:25:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbjJPPZp (ORCPT + 99 others); Mon, 16 Oct 2023 11:25:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233188AbjJPPZi (ORCPT ); Mon, 16 Oct 2023 11:25:38 -0400 Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01200100 for ; Mon, 16 Oct 2023 08:25:32 -0700 (PDT) Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-4577c1ae94fso1911577137.1 for ; Mon, 16 Oct 2023 08:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697469932; x=1698074732; 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=VdJuKEfOYE5A8Kjx9jh0E3Zg2w1jYR6HPq2kjcrmS/0=; b=JcdSr72rvpPlwazyJ0Q57SAwJ7RrLaVVjxiZk94wb4Ic8/AJKYgLMgVERPuyFLOlOa 3HukoMzI24rdo8Lc5jTpOWY9UTe8Gls+BwSiAkmjGUa1zo/X9zW+GQ8XgOOuwcJvqyoU TBtZ75WNkwpZxg6AxSM+4ixSI1gQd0tGKV+xBhIuDJCx821vRpv7kM68r66A+POorETj 6GGeip+lXNUxs1vz8Tz3RfhbFinICPVY8sNDUScrEdrxc6bxkWjp8KW4wnknZj53v2QE tMWo9MoE86nse31dq3YbCgX+S/dMNd1YEWLwj/wCvNEC8BeCxAbejM6pv57+fx+iJuQj 00Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697469932; x=1698074732; 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=VdJuKEfOYE5A8Kjx9jh0E3Zg2w1jYR6HPq2kjcrmS/0=; b=eX3usP0TOzq1yDiJ6l30kPnlP3zTeBu5iB6frQZGFssoWyQ9WJmFrN5JP74KUAMSej edife41n+ivODD0Z0by/qjZTF10VkuWFXyz8KTpn47GNsCbpUwbkCo4Djq6+FmXFi8px EoH6bJOUGnSCDqRsae0C7KwJzdGF1M/X7Gdr4CqgB+fadiLsqp8zH7n1dlKHGUjOgAX8 IgiIPzXZaItStWytBdD//4YX8CYjuBH8Zd2SJPbZMYHk1Nvr2rU1h8zAzEnc57gAWIqQ KE5lJGQ604P6ane04+Rt/4PRfSejINoX7mL8KN0cPEQI9gr8qpx2MMRv+Yh63AOrfOnF 8E/Q== X-Gm-Message-State: AOJu0Yx4vIO7SsweK3h/Yf0KbWE1Y5h1ycdsaUcjmfkkBdCpaq6SrCp9 mp8dDo2MWcMA099reZ8fQ8tOx5WWPehn2YwcTigrB67p X-Received: by 2002:a67:c205:0:b0:458:11dd:87aa with SMTP id i5-20020a67c205000000b0045811dd87aamr1217133vsj.22.1697469931930; Mon, 16 Oct 2023 08:25:31 -0700 (PDT) MIME-Version: 1.0 References: <20231013222453.240961-1-daeho43@gmail.com> In-Reply-To: From: Daeho Jeong Date: Mon, 16 Oct 2023 08:25:21 -0700 Message-ID: Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: initialize allocated node area To: Chao Yu 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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:25:53 -0700 (PDT) On Sun, Oct 15, 2023 at 11:33=E2=80=AFPM Chao Yu wrote: > > On 2023/10/14 6:24, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Need to initialize allocated node areas after memory allocation. > > > > Signed-off-by: Daeho Jeong > > --- > > fsck/node.c | 1 + > > include/f2fs_fs.h | 2 ++ > > 2 files changed, 3 insertions(+) > > > > diff --git a/fsck/node.c b/fsck/node.c > > index 3761470..6508340 100644 > > --- a/fsck/node.c > > +++ b/fsck/node.c > > @@ -127,6 +127,7 @@ block_t new_node_block(struct f2fs_sb_info *sbi, > > > > node_blk =3D calloc(BLOCK_SZ, 1); > > calloc() has already initialized memory w/ zero, it doesn't need to reini= tialize > it again? Sorry, I was confused. :( > > > ASSERT(node_blk); > > + memset(node_blk, 0, BLOCK_SZ); > > > > F2FS_NODE_FOOTER(node_blk)->nid =3D cpu_to_le32(dn->nid); > > F2FS_NODE_FOOTER(node_blk)->ino =3D F2FS_NODE_FOOTER(f2fs_inode)-= >ino; > > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > > index 3c7451c..7e22278 100644 > > --- a/include/f2fs_fs.h > > +++ b/include/f2fs_fs.h > > @@ -1826,6 +1826,8 @@ static inline void show_version(const char *prog) > > static inline void f2fs_init_inode(struct f2fs_super_block *sb, > > struct f2fs_node *raw_node, nid_t ino, time_t mtime, mode= _t mode) > > { > > + memset(raw_node, 0, F2FS_BLKSIZE); > > Ditto, > > Thanks, > > > + > > F2FS_NODE_FOOTER(raw_node)->nid =3D cpu_to_le32(ino); > > F2FS_NODE_FOOTER(raw_node)->ino =3D cpu_to_le32(ino); > > F2FS_NODE_FOOTER(raw_node)->cp_ver =3D cpu_to_le64(1);