From patchwork Fri Oct 13 22:24:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daeho Jeong X-Patchwork-Id: 152791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp2185767vqb; Fri, 13 Oct 2023 15:25:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXQ+PDUKzTDDylspdtK4V9Y0q5QkzET7/rohn9Wv06Ug03D1ZijLoRIG73KzGq1/z12bPL X-Received: by 2002:a92:d3cb:0:b0:345:e438:7381 with SMTP id c11-20020a92d3cb000000b00345e4387381mr27485950ilh.2.1697235920401; Fri, 13 Oct 2023 15:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697235920; cv=none; d=google.com; s=arc-20160816; b=QoZ0LPCdP445riOzHr5caVWHaz1XkBtzqTFLefxho+FIIjj/PiS9A6osTnSJL2g6Zx To/uyphPazfkTOmWta73sFMlg9jlWAD2na959P+Ktj4BOY/tBC7IIPNVYmuF+sfCkAyi nk2X4FW7cNGrn/6t9Dy5PgagWVnDbpfnOp5+3TXrYlGfhC73jMn6xLl5XuxR6qHsE4jn FntqN0qrHpO1BXN4z/Z+CMq79w4VXbag7KiYu7Mv7xDxkcsqsw3W0q14uedCmuSNKwlf jyiNqCXJwaqagx/lZ5Tx+dZAzWlz4cZCNMmW+3Sq62h8xfhIVmr8llB3NqgamC14tlqR wjag== 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.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m10-20020a634c4a000000b0055c7eb53d7fsi5272071pgl.584.2023.10.13.15.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; 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.32 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 agentk.vger.email (Postfix) with ESMTP id 7EA8382EA154; Fri, 13 Oct 2023 15:25:18 -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 S232021AbjJMWY7 (ORCPT + 19 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 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 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]); Fri, 13 Oct 2023 15:25:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779680852130435369 X-GMAIL-MSGID: 1779680852130435369 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);