Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1249233rdg; Fri, 13 Oct 2023 15:25:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbueBi0bUFWzJi3EJm+265h5+s0lDxV2fHAlQf//wAqiYCB+NeoUUnWqyip7jLsSasoWvH X-Received: by 2002:a05:6358:6f08:b0:132:f294:77fe with SMTP id r8-20020a0563586f0800b00132f29477femr27228760rwn.2.1697235915601; Fri, 13 Oct 2023 15:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697235915; cv=none; d=google.com; s=arc-20160816; b=wuo96j+CBHUObW2tMJFmb9eBdUQqp0tBltG7qyFvhcaUhdTwlM8sFhzG5bZ9WAHVQQ TxYYwif/Z/P8NvCNnbpO7VHHkmmxQvQDZOv6oBIDa4riNq+Y2WvEOPSulTHwXyz/FKu3 rBeMZ5YHq1p1iDI1KKFkPqqopknBI7t09WBL+9US9izuKE19mL+oIfiarJtTu/ma+H+d whctzrRxAZuGxFs/cKa2oNqcxW+jPrNnpMbj3QvK8FTMenKX0PRtJIBda/ExdxdS/V9S abPxR/CDyprLijvZBONomnaU4xBYIW4jwhqcWGTy8FCNwbtWJS3qUGKISnUnGSnTZi2c 8GXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/GfpOs8gW0KsSJr+yd9IproIUP4Gx7slhdnmYQ1Acqs=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=KHK3gMw0cN9ob8Gh5VZOOgoM15GGs6CRwilwp2EUDbreN+S3+YLMdDv8mGJ3OGaoa/ CPolfm23hNouvl5dLCvE2Zy42wsI8ELGG03RVa89v/bpVgsLrOLXtqMsPPvjGRm9Yxj7 YI9TSuware+wppswiGTUUqtlM6yESho/us1PPUDL7N5UvWQWJ6pN8J5dkYC4hsAXP97/ FU2yMEA/8FvGTPDBmn/seIDOVVJCwe+lfZFIDJqpz3LfJZ4dLKW09a83fhQtnhaPt1OS Hq2LMDaB4crY5ZVRZWXXKOCevJRF3o/4Lt2ExNti9RQADinow5HYrqzBUULoUbh9AAfh bbCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Bc5MmJmn; 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 h2-20020a056a00230200b0068fc49cc456si18727944pfh.248.2023.10.13.15.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:25:15 -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=Bc5MmJmn; 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 59A418303A14; Fri, 13 Oct 2023 15:25:13 -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 S231814AbjJMWY7 (ORCPT + 99 others); Fri, 13 Oct 2023 18:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjJMWY6 (ORCPT ); Fri, 13 Oct 2023 18:24:58 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 518C0AD for ; Fri, 13 Oct 2023 15:24:57 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-578d0dcd4e1so1829134a12.2 for ; Fri, 13 Oct 2023 15:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697235896; x=1697840696; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/GfpOs8gW0KsSJr+yd9IproIUP4Gx7slhdnmYQ1Acqs=; b=Bc5MmJmnYLc627njKuiKczMtzeZHGcFKdYUJHDXA8sv359OMs1afLd63EMM9OmYvlZ 0gWnqu95osUN+Wkph1hOLVHJ/F7XWDX3N2/KWdlL/+VYA4NP3gapOQtg1TjrKKZr8Jl/ xK9+vUnXS0JDZ5rkl629EPpiaQ/m3tBmjaQ4ssvKhJdhYkWGfLx4A+GiZl4VpYKUT4Qz mgQMhG8/rsL2Cy0/5OIFn4CpDvFP2KIKb6Vs3NChNZefWRaoz4cBIl742EXFLzlrq0g8 F5b5bUa2zOJyPjoHEEbAKpgnsL4N660TzU97R8heii4VY/dsb8UwfTo6KI49i45EMenI uMeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697235896; x=1697840696; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/GfpOs8gW0KsSJr+yd9IproIUP4Gx7slhdnmYQ1Acqs=; b=XOiD32sCZ0/9SREnvYB1Yvm4JgGI3sUOpiMtbZbTsfVWkyjq8O2ZkhI91G8nRIp40y Ryd/Hv/OACqcO2uGfHQNjPocrOSa959FwG4jc4qsdgIVxkGmN3kjkYkTsvQXW38S+aFo K4ksX3TVojZcgl1JaZX2uykBk3SE2V97OLKHeC5Z9oNerDz9AkUHGgsNsd6Qt8jw9hjV +PsPFWqgXHoehAlxizZQDyGQ+GYqnYumbsnABSpZOZH4zkCtWMxqsSj/SaRII5tfCRd7 7TtzzwJhXdmC0U/kw1g+zNWSaWpR0K02ezY9t8D9pmmakIrPyJWoJ2Pi7dx5UObHKb74 PwxQ== X-Gm-Message-State: AOJu0Yx/PInWQ/pOXKjWLA1zZv2QuPpPdBiucQYK0tMLBkX8j7e+643l 1xwPQIAaHBLPFpe+Zh3zvVALkuZmNRA= X-Received: by 2002:a05:6a20:6a11:b0:15a:1817:c493 with SMTP id p17-20020a056a206a1100b0015a1817c493mr28467802pzk.39.1697235896437; Fri, 13 Oct 2023 15:24:56 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:86c0:c2f7:f3ba:33e1]) by smtp.gmail.com with ESMTPSA id je6-20020a170903264600b001bbb8d5166bsm4366891plb.123.2023.10.13.15.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:24:56 -0700 (PDT) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs-tools: initialize allocated node area Date: Fri, 13 Oct 2023 15:24:52 -0700 Message-ID: <20231013222453.240961-1-daeho43@gmail.com> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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]); Fri, 13 Oct 2023 15:25:13 -0700 (PDT) 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 = calloc(BLOCK_SZ, 1); ASSERT(node_blk); + memset(node_blk, 0, BLOCK_SZ); F2FS_NODE_FOOTER(node_blk)->nid = cpu_to_le32(dn->nid); F2FS_NODE_FOOTER(node_blk)->ino = 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); + F2FS_NODE_FOOTER(raw_node)->nid = cpu_to_le32(ino); F2FS_NODE_FOOTER(raw_node)->ino = cpu_to_le32(ino); F2FS_NODE_FOOTER(raw_node)->cp_ver = cpu_to_le64(1); -- 2.42.0.655.g421f12c284-goog