From patchwork Tue Oct 29 12:09:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57694D2AB2F for ; Tue, 29 Oct 2024 12:11:52 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4h-0002ZU-9s; Tue, 29 Oct 2024 12:11:51 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4g-0002ZK-EP for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OAZi8jyRmx4Yin2OXUuffdcwmer0LMgPpygGaKQl8PU=; b=JFhHNBmtZWWMDimA6gcqHx/mBM AULvYeg8SUkpWrPlhNNaUCQZaHbc7gE1pgCTvNSxYj96GO2l+ocRbGr8nMxiCnI3YmqKLJwKsQ4Xl 42LB8N5FYcwtnLY05kD1nexuGHISLFSb8Y/rSy5ltfvc4jO4YcFxbA1W5e+WcuHKN9FI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=OAZi8jyRmx4Yin2OXUuffdcwmer0LMgPpygGaKQl8PU=; b=fyUgTZqi4CXWmpX4VwkfLtv30w iQ2W6N4WBCqLLeVpC+vfeVYGRtJPv4TxDQcbrBGk63NnTRx9CPksUWxsMioymKrfMf3NJhFyGUpmc bDKKXgKDUaYDwREyIQgCjnUx7YsBnGj+zAIKr4KU0dkCiqeF/FTMz6dCyOW2as/abuCY=; Received: from mail-psaapc01on2053.outbound.protection.outlook.com ([40.107.255.53] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4f-0007R0-Lv for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BPpLouF0Ozq3ENoKGb/abXCXsEBi83at6HCwL3jlWGvlb0Mt5mq+1D5vhK/sZN+b5BqQmYHBWkF5BfXpi3SxdAPZhYy7vrpIkhAWeTIzKbKKFRB3aLCP77SvTIdcakaXtaBC3VdL9SIQeySfbTrzM+iD+kIcsd8zKRSvdbNvE/7VgJlclfAlMpV1JsY7W87D2U/QRLopmGgwPLN/ciq7k5TLki4cjDOabDkcuW+tQGaqtRpwgRbuH/7Gg9FdgzozzpXWzyFxxp337yBSHYumZHgbN1zUfwk707i6uRwR4HR98Y3HdP3LnLlmUDzesr782M8dVqBuBFE9Fd1o1xKgHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OAZi8jyRmx4Yin2OXUuffdcwmer0LMgPpygGaKQl8PU=; b=x5qImoehv5KG9RSnl3zzn7FGN+Pej1zszCTjdPFKl6BkSgRL7OxtuwLStuYU48FCff/SBInxEd6Dxct9hNv998Zx3P/wYT1zJJ8q28EBMs7JCyXr6AGXHnK7N30uIjNHzA9XRb2RuhCxyZzy8194oM7kv5GxVwdNzKa9pNuyhzc122BJWudNV6bXRNgaheSXrjK+3EOoy0qO67H3bpMNFnRxgXxhA4mD2TGmjW8HeQVNOW1xoTZkbSQDJTlvMRNqp2sYvDCzzTTy4B+5gzUEoASwbhZVEDfb3hllt7GEBL0FTEdgIhWabKBgwcsisSMhFPesSgVsPpT048LSyc5RgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OAZi8jyRmx4Yin2OXUuffdcwmer0LMgPpygGaKQl8PU=; b=S3C1Ex4EtmdqYv8hret32Jlr8nyVbjSozk7HyJpUL0AS9ZUJfo3pgkXwEgzMEL9XfCKkUMWz4WoUI0KU/Fmkc218L2Qbq6Auukmz+vhSZR8rdxpsZShPHDTbzyvxJakuhlsMQkKyGCzQZ6XL/I8xeYpqfYktsc2ZfMYofvU4Xac= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:28 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:28 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:33 +0800 Message-Id: <20241029120956.4186731-2-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: cbeb8396-5ab1-475e-9623-08dcf812d148 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: w818jMHVwCsHhZlzKRDOXviw8bPL4RTdCKys70ZsoMa3IZnIrJ37CewouTWo3ThNYPqgSACx4XP/RU6jGSgIpv+A+b+ROkH6wUtHgJs9BfxRxFNS6PPNM4TlhZXG0G8OYsRbN01idAUs8dgbCTPaE3xRuhPpI97B+mTh2BQiq3qvw6uwAarQKT1dPgurjDm5915iNbCSp8mdDrwIJPUdGPDbWu4zvOUSkGXixDwqAOaqYPDqh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F4Ipkenb++RaPGqynBoYOBnstXw229aErfJkbflhaos2pY/6gMy3I4nKBEwD3CYe7xVGY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vSMdxUi+kUl2FTNQk/hslDAz/tw7FH9Udx2ZlfsrDRi618OFXEw6WSREV5efS4RWHJc8PF4Obh3D9vnB8z9Lbv9ARFSCSd9Of7/Mh6zWQ98vpzEksopXGrAMvJo6Sutx+32qpRkQbdIQrInrc+8pQoJk5BW7SJ07lNDfLaNv57ukdcGvZW6cBO9alPXOB0VFtxA9yQCux5o2ivaCVI1I669IKXFeJPnYu7EUVZ7NTUbvCsTSbBsJd04SAhDiGnMJfpI+QCuiuJgOPH6cS3iAMxy1i0aX2nULUwixxtrZPlAjGM84s6q2EDUsBLu5Pz4zDm7VGR+s0Tyka7K8iXJr0cOI328unZ00Be0B9aQm7OCB/5Rtixr/cGA7Yb1n4fmR1wzgJC/SjSPLf1mYP9NM1CFaRGDKfoOX4UQuaAEx1Q/CiDnviTyby2at//m+xnBz8rCDO1o7bXbJ0PXWeX+k5jc9CCwM7nXKimiY4iZCuj3rRNj1ZqIak3Xh22WfbT0mG0DJTtZx+1+K7xprD3O0n1TX7/4x7WE3DvJ03yysEj0xrBZJSB4arGEwQbqpVISSUz2amxmG6Ah/hrgEP0aB6CrgUyHVjVVY8Gc94GRxJeiof2s8Bl9yEBUiZ6aoJEpFEhimnyeEsi/dvG0OvhyruGnM1qPA1aCS5twhqs8ZkkZFzABVcJnwz/AIv8KC67ZKL8Rx1VV077iQK3183kG+zoQzWar7pcrcEba/PUZg/VSbWHhtSfxpfdbPzBjis5+mEHJ3k+AOpcfXJlXqw203YuBNmYfl2T/rd8fvF8ZfZ9PFcIKpOASMJdeE58lOmZLSDyg1bUWTeolYNTlSxLhhCYixqz+VzzmytVVO1ZOLUn4dS8ZBRNXJMRfgEZWwsO7WLzw7OEMy9MumKmGXJVYePki8o38BdnAptObLLwxn/zB6m6SiHJbiWnheNu6popWpjpXMdr6bZ9iSvxhFB5+/f3sokFcLe481j9TUVZACwpMNezrNGkTeC8tF70X10Nyb/hpFumFYV6ud610I5fyDDTc3+kpEzNpl7JGF0rEjYpN+lIJZD2jsb2GAnjCvQDu6GkLqkzbNGcDu78BZ063SXQChxweo2C8HRa0Z1DbRQyvi1PMZC4xbN2U/11m+ExL/NLx9NmjWnVtg5VdMw9xNZMbZYSyiRIJQK3VOvY/Fhh/s8AKwxJhCU85IOPzxLCI1WeDhMv/3NPJinQMl2x56ygwWFE3OcVzx0ASED597CmJYUQw3QPUNwIRwEsRJJ7GgLmQBtXY7RIUNjWs39EheD0CPorWC99yqIkPld7xJ5fviMRaKaRZhq3bKCLjCaW9L+V1+4NC4f+I4tpe/W+4lGRD3QCT3u8m9cGn5beeMotl+fB5evbRtsicJm9snnjv/G640gS5Qn15TpRrDJerDncjU2IM27a7KVD66oGdApXKL2xGXLb2QB1X0Kx/dGZjF+YgXicWS3jF0GPrYTfDkj3aqbMRFydK/M0nCgXZTHP5orAgXV/q5CyswBVOsQ2bqu9GYIU6uVfMakkxxuso3rVnkqeayMY2Ip707JfqW+e7F4LoSWk5KVMZ+cXYL33vI X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbeb8396-5ab1-475e-9623-08dcf812d148 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:28.5816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RphgvPqLfcqNx4bZQxt6P8ZN8gjCNYwdT3QzylXnWEa54IeqiIy+SfZ58AB/NYuglsWX7tauB2AuiYty6xzPDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4f-0007R0-Lv Subject: [f2fs-dev] [RFC PATCH 01/24] f2fs-tools: add option N to answer no for all questions X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net In some scenarino, such as autotest, it is not expected to answer question from fsck or dump. To simply answer no to all these questions, this patch adds an option `N' to do that. Signed-off-by: Sheng Yong --- fsck/dump.c | 3 +++ fsck/fsck.c | 2 +- fsck/main.c | 14 +++++++++++--- include/f2fs_fs.h | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index dc3c199bab7f..8caceaa4ae06 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -681,6 +681,9 @@ static int dump_filesystem(struct f2fs_sb_info *sbi, struct node_info *ni, if (c.show_file_map) return dump_inode_blk(sbi, ni->ino, node_blk); + if (c.answer_no) + return 0; + printf("Do you want to dump this %s into %s/? [Y/N] ", S_ISDIR(imode) ? "folder" : "file", base_path); diff --git a/fsck/fsck.c b/fsck/fsck.c index aa3fb97a7022..5a2865dacaf5 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -3693,7 +3693,7 @@ int fsck_verify(struct f2fs_sb_info *sbi) } #ifndef WITH_ANDROID - if (nr_unref_nid && !c.ro) { + if (nr_unref_nid && !c.ro && !c.answer_no) { char ans[255] = {0}; int res; diff --git a/fsck/main.c b/fsck/main.c index 25d50e29b6d6..b6e9bff6cdc5 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -86,6 +86,7 @@ void fsck_usage() MSG(0, " -t show directory tree\n"); MSG(0, " -q preserve quota limits\n"); MSG(0, " -y fix all the time\n"); + MSG(0, " -N Answer \"No\" for all questions\n"); MSG(0, " -V print the version number and exit\n"); MSG(0, " --dry-run do not really fix corruptions\n"); MSG(0, " --no-kernel-check skips detecting kernel change\n"); @@ -111,6 +112,7 @@ void dump_usage() MSG(0, " -f do not prompt before dumping\n"); MSG(0, " -H support write hint\n"); MSG(0, " -y alias for -f\n"); + MSG(0, " -N Answer \"No\" for all questions\n"); MSG(0, " -o dump inodes to the given path\n"); MSG(0, " -P preserve mode/owner/group for dumped inode\n"); MSG(0, " -L Preserves symlinks. Otherwise symlinks are dumped as regular files.\n"); @@ -250,7 +252,7 @@ void f2fs_parse_options(int argc, char *argv[]) } if (!strcmp("fsck.f2fs", prog)) { - const char *option_string = ":aC:c:m:Md:fg:HlO:p:q:StyV"; + const char *option_string = ":aC:c:m:Md:fg:HlO:p:q:StyNV"; int opt = 0, val; char *token; struct option long_opt[] = { @@ -356,6 +358,9 @@ void f2fs_parse_options(int argc, char *argv[]) c.force = 1; MSG(0, "Info: Force to fix corruption\n"); break; + case 'N': + c.answer_no = true; + break; case 'q': c.preserve_limits = atoi(optarg); MSG(0, "Info: Preserve quota limits = %d\n", @@ -409,7 +414,7 @@ void f2fs_parse_options(int argc, char *argv[]) } } else if (!strcmp("dump.f2fs", prog)) { #ifdef WITH_DUMP - const char *option_string = "d:fi:I:n:LMo:Prs:Sa:b:Vy"; + const char *option_string = "d:fi:I:n:LMo:Prs:Sa:b:VyN"; static struct dump_option dump_opt = { .nid = 0, /* default root ino */ .start_nat = -1, @@ -487,6 +492,9 @@ void f2fs_parse_options(int argc, char *argv[]) case 'f': c.force = 1; break; + case 'N': + c.answer_no = true; + break; case 'r': dump_opt.use_root_nid = 1; break; @@ -1311,7 +1319,7 @@ fsck_again: f2fs_do_umount(sbi); - if (c.func == FSCK && c.bug_on) { + if (c.func == FSCK && c.bug_on && !c.answer_no) { if (!c.ro && c.fix_on == 0 && c.auto_fix == 0 && !c.dry_run) { char ans[255] = {0}; retry: diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 0cb9228288c0..d601e912bc52 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -1545,6 +1545,7 @@ struct f2fs_configuration { int whint; int aliased_devices; uint32_t aliased_segments; + bool answer_no; /* mkfs parameters */ int fake_seed; From patchwork Tue Oct 29 12:09:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86080D2AB30 for ; Tue, 29 Oct 2024 12:11:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4e-00040N-Si; Tue, 29 Oct 2024 12:11:48 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4d-00040G-K4 for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=drDBWrwXRY8LtJNpl+46/BUfyZ5jgzrP9OsYImnymO0=; b=dATsQ2dwE/i/b7fPLNzFQ8Owv8 A8oIAfS3Ebl45p5FPVuw/KJrxjJV5Xrkr747P6DupEanV7lkQgLA7YbPMiwFi8mNWGhC47moLSfzh GedhDZj9gdyiMe1yVOZgeQY3Ezxh1cQlyiPfgCFtC0hEq6H55lMRc0rJEpj+n2wpfx0I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=drDBWrwXRY8LtJNpl+46/BUfyZ5jgzrP9OsYImnymO0=; b=dSHkfIrB4mC/O+xiQ/nthwfGGo lqQ7NRYz9Ywa8AlIXIOrHq4mcZqmQYUB8ER16YielESJd55S3RtFWuy2mCgn+Zq7A4EDtkI0gMted YOm7zMvyH8n1slU/0M5aF40eGQlmDdIL8+QILkwN+c64/R3HPn4c48iWc6mh6p+2+D3g=; Received: from mail-psaapc01on2084.outbound.protection.outlook.com ([40.107.255.84] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4b-0007Qb-J2 for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AuqwTraBTpzdTWdU7Lysl42f0X6pupiKnyJtZsm2CTRyvsly13YTVo/qgvnUwarLxi/URFLtCcgLgCu4e2mnqEa41U9nelGXGn1PWnrsnNBiE/r9ESf4o/a00X6SyIS+MTJsivOzhG91R3MQyjfftfdpFc34RTqIOINxaQGSq7BdLK2tDLzEISGS9iq4fivB2aA9uMRJT0CitgsMsHoF3cMtGhfqIdNad3Tj/807kCWbOJDfLhm4FkEmXKb3ehgmnFAUM4d8ZkqjAkzCbUapO/9SJSgmHT+ekQJYsqnuK4hsBYh7HFyBHVJzdBjIVlqs2FyRU+a/hy/ORwAwLCI3Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=drDBWrwXRY8LtJNpl+46/BUfyZ5jgzrP9OsYImnymO0=; b=CM5oUBPfxi5vG6L5A8TyRCKPBBp8M7aoFGdffQmomSaeqtRB9B8Noakc+DHB6HISH8vawDSASDe9sB0QHseJzzLqCd2ZKBeX9l2ojTdrdzhJ7VfOIcuYWLaJt92TyKLXW9PpMMulwP4D6bL5f7dinDzD70v1voqC5IOxbQpTOzlaP5Hch11tSnyOyUpdecW6P4lwKCjsamYdXWD/m0J55rOEPF4h8zVOyxjgFAiiqqW8Hd7NzuvH0yTsqvu4nPMJTcsBEwKInR1yX5IjdOoFl2hyBDwCmU/QStUWVOU+wQ9+jF1Yjm3I+HSOgf9YKPUBTfhE/Oq8savCYOvqNQD1Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=drDBWrwXRY8LtJNpl+46/BUfyZ5jgzrP9OsYImnymO0=; b=LJ0Hs8wzFvaZpx9QleV3Ov2w7AqQ5MkH0EEkOUp21DaX0H9T9SDALMeq3+zdEkwRHTL7BD96T9ueuUPbwI3PE/AEFDTvQaKLaeSHCac6/W8iQtmVDOEi7oKZ/MXwhvT3L4em0YLIFZgSzZvkX1hrsZcvRSuxWSyT11BFtXuifUE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:30 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:29 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:34 +0800 Message-Id: <20241029120956.4186731-3-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bc2b2d1-b5e4-4c87-6692-08dcf812d201 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 31ui0+d1XIWSc0X9LraG5m0Yj10wEmluGuEq1Zse/7aGEVqMK11tHy5o2cq3Pm0pdEgDsKF37m7HDJSUR8sty6spn9V6Gyxyjx4WbcL2bUp/Z/n0l1+KojCbyzz3/dD6vU9+I8w+gMgiipSSvqtPQ3h6FAA3LWWsUJfsyFWN/5cSqTUbGU1rmN2b6Mw1qVG1XPQUaq4fkI/jFZ8VQhgZ3w8GYPWsdXdz1hD/X45DUJGvO0lDsp3L9eR0O7+ydeP2kI/ICim4UChpKBRcdHQRSpfcoDBVlDYZPIX8ijjsokKdkKjmruksnJHghRsbkh87lZNoQRm+ziBYrmuh1ss1dOQ3B0dyY3gTNYgRDSeBdbmI5g4nhWptr9CovRLycemLm3lhuF267vqDQEZsB5GzQbf02Ep/OwVntKxNWUBkKLP2N3JeAhFRZzDreH/npba7PULtqe7A0SjduqR5BOu75XofVncjqb8PzY/WoicyDbn9oxJG6fqkRa6yqtf4KQPXM/mECiRjP3knSjd3hlBJr2YswjxBjng7QzhgkqyXHYAc7EA4h/rq8TeygLrWCrhvHcM/2hEy1B9zyXY9eXUE0gQiv6L62G+AexSEh4hck+YbFohsAZJWIGrrVQu31ZvZfjoR/0CZ8/VBuQHNMwOpc1BPXgCYJwgsIiL3Iw6xvlpJpd4pD7YfB9xu4czgNA0iqe/mx6hevmHobkye7Vy8IgvNX+iVCKNHqK/HclUrbcol7h9A7HjAodQpzl+AMB2Emqao2Z5R/uxzH+8bAPIVcl0eeeLjB5q/+uIG1EExb+5CBiath9noWrXCJjiBeJ0bOjPIzGRmIIKb/nXrpK4WZ3IF9Q5Cw84QWn8m2aibLRH6/1/t5cE3pI/H0sUx3ZyLuzCm2Vin8pqlW0Rpmg/dNBSTQYITlTx6M1S3feJSa/uUq5UkefG8BCtCA4fyHiA5DJsi/Ljc4JlPu7VM0Bet9VOROqal/UzGsWvUrlwIQnmBq2Xb686CWvvAa8YqflCo29Z/mVmNFjDz76g/xRC96UqNvF5E+bRqjk8FWR/7aKLSbqX+ZW9qSctKBkE7ORT48bYX8vUyMIt/Jx9h8KcJGJTLC2683HIKnIxnDiLR0O2rzg2qNQ4LsvaK3iCiubF2t9vW6B6Diik4Yeqc/PQQ/NM10VGKxyoR8c1lpyTV+0xsnZzsR2+kmgxQ3HVmQ/hadouMNE5rXE5jMKATw3Co3RQdW+0FNa60kHR4t+SNd0Q73s4u3nzAu9gHC4rfVr306I6RfncA6mFjV57+SIyiuySYr+qE0XS5Z12g8Z31hyKtLhQwPQ9xgcb55XvI8AViYSB3f9kn1lL7Avi4xsDfGX+yONNVWxMbbGckfWuTdRA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2kNi8rrJtgfa1VezZ7vgRl3hZ6+zRcZKo1TO95wOUzIJCnEBdraeody1N2FC+b2SqX/WlNAuDwBZ03wucp7CqGGQzNK1iJV+9PTEuBcafvwaFrW1BM4en/88fgdsuNHr2Zneii5A/6rVGKdPwcIaC2qV+wMFoAFNTnl3jMvx8FlRSLUgZ3r05JhmJJj8PSs7zjs3av7RFtkaBIZld96BPQjvicLB1//y2/b0mjY6SdLhWOGLY7vTeMynRN9MzqAJmw9ttpND7SdzHGjmU7X98VGOlwJobpQl6nK+bKAg1k7EwWQAihXn9RxwFOanm+/MorMNzYaOxYNElKQWTaAqDUPkHUmFqEW01F0JEQPx45oLj7GuT0Z9F0jrttp4RTKvDdgu0+sxDJ7szx5rBpflYpEAXQQUEFYoGZpds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QycuWw3Z5CDFPF69XTGPsVPiKxrczqQWYSxN+7to51f/WbRn5ezBo9zi1YxYQr04SYVH6VZNPduZjYYhqbi68NRt0YBNcJ+COP2 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc2b2d1-b5e4-4c87-6692-08dcf812d201 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:29.8334 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XyPd8B5AdQFHLLwtaZLLGAYG2chny4cUD4Ywi1fUTu1rr1yxxDrCvJGUffhTAraKFk6CS64hP/6IJ+9XvylVXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4b-0007Qb-J2 Subject: [f2fs-dev] [RFC PATCH 02/24] dump.f2fs: print checkpoint crc X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- fsck/mount.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index a189ba73e4bf..a09a974fc810 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -560,6 +560,7 @@ printout: void print_ckpt_info(struct f2fs_sb_info *sbi) { struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); + uint32_t crc; if (c.layout) goto printout; @@ -613,6 +614,11 @@ printout: DISP_u64(cp, elapsed_time); DISP_u32(cp, sit_nat_version_bitmap[0]); + crc = f2fs_checkpoint_chksum(cp); + if (c.layout) + printf("%-30s %u\n", "crc", crc); + else + printf("%-30s" "\t\t[0x%8x : %u]\n", "crc", crc, crc); printf("\n\n"); } From patchwork Tue Oct 29 12:09:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAB67D2AB33 for ; Tue, 29 Oct 2024 12:11:52 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4h-0003zm-KA; Tue, 29 Oct 2024 12:11:52 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4f-0003zf-T4 for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sMZDrvESraSmy01tSsVbChbFpYkFMftk+RYkxgVIJVY=; b=GjH8Ob8MhMdd8MpwwaDEVQ0sdE tiT9FusUcRXYfbEwQnmte0d2TsU9F13nXUE2QBlYyYxWfA5x93dywuchQ05UIeJdqySllAQY+ezPv Wry84aP31MxOidj7l+vQkE3ZIE9iuRK+ipKC50rt6xg7GM9/ysnlmr+WTnPr9McNUvPw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sMZDrvESraSmy01tSsVbChbFpYkFMftk+RYkxgVIJVY=; b=NsYXmjjtDiVQNVYLsvicYM66xC c3HOXMiFN3Q9yqDdnt2ejNMvepIhiHnuCoSwnPGnAUsS4Mco6IUTvb4hCV1VFaw4GO8EQhzgDeU8I U70no7CqyAt5ddaAcBKUpB9Rl8MD7S3rT8dquAeo+xhG4QvK+SXhrcZy3krNxK1eUnC0=; Received: from mail-psaapc01on2084.outbound.protection.outlook.com ([40.107.255.84] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4f-0007Qb-Ud for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uhEhckUek+ajd86P3XnG1RTiD//TPUpPe4b8aD8KWo1OJVtefCjhw0mhq30tPGL5u43dDk5GZYdGzgCnY7C13PryyvbtcujCO75dN04U2Icuvr9m/odqHfvdt5JcMq3teTEZ+v1OedUAjZSxfRhXp2Eo/4lahrAY9yPxd9PhxIWqv0V2z9SeE/0hjaFjZvB7q3Gc/rgYzcZUpeXoBbe0xJW2zERk1TcWbP9F14tM0UhynHh/1NGn49GEJL7BU/nUOSvDHXDJFNLyNR3kY8WrAFWY0a9yEin8rHU4lqPUcrNrUBUiqv5pVek2SXLWpLt0AxjRwETimXH+nOCSMu2Hlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sMZDrvESraSmy01tSsVbChbFpYkFMftk+RYkxgVIJVY=; b=N1ZwW01pvqD/LppQovlsJSXI/CE78o+7G43zcQUn7xRKQh1Yi2wBgmjd/aqIRrlBKZLd7XO1SzyryksWkRb3HiS2gAC7JmkdISxnCVemokdNoA4ymDOdAyLBRh/P7UqSVMgDAg+2Z/9+6YXOIkGeqYnmjydXokLNr1Q+HRXcx9cRW3fJvkt0oAQdM57zmFYDbfVH2GuCMuA2F7ml9yMoJ+jPS+F/hzhsc2wi4hM38tUkrOTMvUHYIF46nRDhdJxxflsZEuSN9WS9aloXLIDOiLy7wR5fp3PuqqkdcrNF3R7Oy9m2BRykeXln4WAjbVOlcr9FgOeCZ5wpc9cs532fAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sMZDrvESraSmy01tSsVbChbFpYkFMftk+RYkxgVIJVY=; b=h0poWzXMM2M+niJSKZXm0Ux/G4wMBax9GkPk/QaAgpGv4r6Oo9uZVvz7+iyBnhE/OxUtZcHUlo2v4r72tm0JQqOH9jaoOadNVT+0bmc9IMFgnPbxJQt4LEu+15rwJWAonxqVrgy8+EzjVGyWcttvG9jTDyKnJKPdO/nAvc7Sv2c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:33 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:31 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:35 +0800 Message-Id: <20241029120956.4186731-4-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: d7856129-2ec5-4b70-6b5a-08dcf812d2bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: cwXuzryHOssf2HA8wDsM4xU49gmOMcFMINaehXyKpRUwRJcpW5rz+5wwdJqLo/bZ2U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AptBGeDQr9pI6ywfEndsqPfZ4upUsbk/wv0O+8YEOdW9LzdyX3GdDvFbj9wIgzkr2a6qrw5Xt8L6da09UVDstA+ZPSp1R+8E/4F4lwXUsVDaTeOosdcScDDMhrb7xZEJRM+aRuU5bTiM4X1FO0tYXXe8WRRyqZd8tgxVvyKFw9Ds3eSdwT9gS8zt0XPR8eRpqgKM2bx5Ts4w1VrsnNr7potsKo6QQIFNB/yhiUvIk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SGou+dS2ZebWSAH6ZM1RuRGSRZi9GJkLw9CFbMLqQEMfWe6BAdjebjj63QzcrhtSsVA9jO8ZrPRxXacWO3hpod0zecUP2q15/Vt2k1Trmau+mCme9KyxYrNidUJbJerdcSFsvI5adhxxUKFpwdWjJhYnc4/91SVSbSTHMWAKleKqc3OaPITsY8k+8o5rOqL5CQumjS5NVLZR0/GPeWEOqM9gY1CAc7vfs5Fe1uTt58eibrxmlVa+VHgxEh8yPCO3bqs+lHpoZW8qVYJVIuQ8P8mUqZYfo5F8Blxu8Gi0W1wTDnrSwxzAhw/1IjeZknWwx4RKfRc8FiYdmVUckeKaMSod+Y1QXaaCDDgoaAaZgm2a9H+MX8fNS+BmOU5ceIAPG3H/zIUw/zcDm5+ORy5ChCQ0e3rqN8VIsKZd9KEJWhl+BmMC97yLoH+UC9KgfOiUmOaexsb/75LiACQMxWpwwA/IW0zGtRDfTjOnKw0KnuQQdQigfxbYQrNyqSLV40yV+lEfdLtNcT630lBobXP34VTCXH+fTJ6gqO07WSzG748hbPU+QA8e4VTZ2fOQn84NBTZdsYQ+F1IHxXUL2h5lF6D2oiM9hV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CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:31.0355 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 66yEZ3664VKVbeiuhDFLS+MX3Szy3rdzIKutisQTR2itL6ixwPgiY0iCeEC+lEjrT7Oc+U1/VC2vN+x79zEgyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4f-0007Qb-Ud Subject: [f2fs-dev] [RFC PATCH 03/24] fsck.f2fs: fix invalidate checkpoint X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net If one cp is invalidate, set CP_FSCK_FLAG to allow fixing cp at the end of check. Signed-off-by: Sheng Yong --- fsck/f2fs.h | 6 ++++++ fsck/mount.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 187e73cf9aec..651a1f734281 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -346,6 +346,12 @@ static inline __u64 cur_cp_crc(struct f2fs_checkpoint *cp) return le32_to_cpu(*((__le32 *)((unsigned char *)cp + crc_offset))); } +static inline void set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) +{ + unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); + cp->ckpt_flags = cpu_to_le32(ckpt_flags | f); +} + static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) { unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); diff --git a/fsck/mount.c b/fsck/mount.c index a09a974fc810..bbe29dba0f45 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1322,8 +1322,11 @@ void *validate_checkpoint(struct f2fs_sb_info *sbi, block_t cp_addr, return NULL; cp = (struct f2fs_checkpoint *)cp_page_1; - if (get_cp(cp_pack_total_block_count) > sbi->blocks_per_seg) + if (get_cp(cp_pack_total_block_count) > sbi->blocks_per_seg) { + MSG(0, "\tInvalid CP pack block count: %u\n", + get_cp(cp_pack_total_block_count)); goto invalid_cp1; + } pre_version = get_cp(checkpoint_ver); @@ -1387,14 +1390,16 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi) sbi->cur_cp = 1; version = cp1_version; } - } else if (cp1) { + } else if (cp1) { // cp2 is invalidate cur_page = cp1; sbi->cur_cp = 1; version = cp1_version; - } else if (cp2) { + set_ckpt_flags(cp1, CP_FSCK_FLAG); + } else if (cp2) { // cp1 is invalidate cur_page = cp2; sbi->cur_cp = 2; version = cp2_version; + set_ckpt_flags(cp2, CP_FSCK_FLAG); } else goto fail_no_cp; From patchwork Tue Oct 29 12:09:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D0A4D2AB35 for ; Tue, 29 Oct 2024 12:11:57 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4n-0007z8-N5; Tue, 29 Oct 2024 12:11:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4i-0007ya-3W for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ygavBiyoAdJZBmxeErtBFpcQo8cb0+0SesJEOcOGR/Q=; b=hyoRx0NrqnjD5+Q8WUePXj39K/ qxq4WZS4ZLZHxJFsfHXHJ0nuNOG203kxbrScPx+Txd+kP3+SS1rwK6+W9Ki1xywAdLSr98U6xRFhm Wm/KWd6XAt4XBEAbsiyuXynX01/LdrLmhK717BPqXl+W0bmzzPGQU2iPJ2zefssLWHXo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ygavBiyoAdJZBmxeErtBFpcQo8cb0+0SesJEOcOGR/Q=; b=Q+wt4kDlRK+MBWZSuTrXv29K3h MRLJX7FmdTSmLcjYn0oWfccyN5Oh2ywj14pNGu3iuBCbXGqqfqaP6pj0Ooc6s4k8cowl/Ltc2Zkue f27Jo/zQmQDa8vn/rfcx7igH7rpu9JbJvPaWpiuGtrcKkbCGTtIs2g6t0TPj5cz0t0I8=; Received: from mail-psaapc01on2053.outbound.protection.outlook.com ([40.107.255.53] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4g-0007R0-Mc for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hUs0F5RTJrDRfoAkx4yFUCYr3rA+NG9sBVNSoW7fL9IwGKAeY2NkJDKGIJjExn5y2YQCccr2XAg/UjQviDyJCkGyq3PCxk2E2aGBQCSjmfTw2XcCX6gx7r+fEzH22s4b+GZ/3X8nJUS3+lIZnemvY/bKD0YZB4NpjrSodFvJKf1XnQQrJ+qdxmPMUhnwc6NysJaR4exZydDN8yDkMvFEegyDXFCGrpdJBFpmjgsc2k5e1akzpnMBuWSyOWdrkDxPUJTMR3xzYFqfikHtTn47g8MVicUt0mGROL1CPmKcLdE2MBEQF0qtUABPfpdG+qsDXECNMGz/N863RvBgI4NdXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ygavBiyoAdJZBmxeErtBFpcQo8cb0+0SesJEOcOGR/Q=; b=EYnw5ARzrgia0IpngHVeTYtQC8XI11bi7QA9ra57BkeAPYUX7U2AjBJRHtkGDm86wqifPkegNGwlSZOW5BUGKtgWsvKPZdVE+Ju5xCnjkgh0wj7il3+/wYrleeTS1Xk7+rEDAYPnYrCSLmFx8Qe7pSbc+hlVQ154tASV0Y+0fM9qjjRXZ3IzDDKGtrIn3pia1NjlxrAwqL/4TPzWtdgPmGrGYfe3Mf5oWqiqJZ8SIUEiKhtKJT/R3ODm2cq4g4d2YlVIAk4cW6/QB/MD6KU3YRJN8C+kBKpbR2NCimyIWdNmnWPbO3WXYH9FdPLNQ/UasPjUuxulVm4IQhojwYb2+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ygavBiyoAdJZBmxeErtBFpcQo8cb0+0SesJEOcOGR/Q=; b=aNnrDfFtpT8GJinXAJrDNqwrW+tL70f7M1J1We0tUPPUbeYB8Eoxd1rJRJ+IHGlbPw8E0Bjqw/L6UDrmSJyEFW5/sC+mSrX/RoRBrpfv292FRdxjOMiDbX01W01v0B1HokS7o6OhDzv53ZyobTe7xxpIu4kSqbGDsJ2ooKr7Lz4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:33 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:33 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:36 +0800 Message-Id: <20241029120956.4186731-5-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 57bc458f-f444-46a4-2b0b-08dcf812d378 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: cBG3pNELcOViP5Kfw6/M8AQqB2IFrlsGbcMNJlme0jDgxKBV7jTsbmzYgl+9LQEillD0As/tU8Bgi2Sgopp2uIEn8qTtgpGphKHKU5gkz2k8T8C2NtSxjvkKxAS8sedUUbCuadIYtwdaJhHJYUKO3Cggd7kO26QV17EbARl60ySoll2kBcFosLJKm5/SpJtD6bwv6Nyub0PnbLdMkawf/MTnOoCaNxWeEqloiGOLm0KyP8FB7jkcuA3JntcRs7lbiWgBBWhWfEcHBwzv30XVzgeqZpwBmqkt6XwkQG2lnL2Diq0PO9CIT/zWepVaFUDkZAKpAigoD1hIYLJGgipQ7ynIRHbSxPhb0VOjwBMiUt3szHFbRv40RqvMSrec5c3q9lWuDZEpag3fZarkVtnQnAxZrCDyQZ5RJkDoSqj3zqG3k5zEYTKzWQFv0FJv9JSmJNKvvoiudkmumdiryd0bFjl9KGHz7BRrtBUqZOek7YTCBXGODReIwIAC0XAoJcj93IFr0oP9eJXgwh2XJCl67phrV9mxGAfo75/pJ2jUdNHPZat5u9V93u0vsTs5KTzqU0kXZjb44wCh+pkSjWFkUNp1/Awd3FN3UZQZNGCE2VNa/Vs87YNO4xOevwIB2CVFJea1dmHnhjyGQfETADmZ+prHBFUEvc0RpYtfhgVigyddI214hxQLo+xZED9JFeiHJY09t7fdivTMGHYXnO1MVWN6/8OgVgYPpuGKP7EJzGG98r7wVAvPd6D3t5z8gdrRn3I9ua/7zn8PN7l8fwqB/Um6ynM5pn1mF+WbnnbNGOJFLibxUhBftNbrsbVBxj4gcKD2m7+hX2cIo8XkWujmHCIN74ZakdLgPOWCbmrSkgi/txC0ByUL7057wh9uKi+S2avAurJSw5FfFMgN6EMmaelcH0UXd67i9GBCcOY2bumZXXLGer4penGcWHShTz5D+oxeTfYfAx4rGUNEUfbHeE4+zirnAFCBdwX5M1j/qLo9F9A0Tlosub5zWrpnnpCWrKOr9m1KDzWgbXa8lCcMX3YiMOEFqpX0qRZtZExXlupKd7Fdtur8ZMmzOmTHPEUXjQldUACd3rei4cpGakXaG89dY4dfIsCTMQVLdg6DjxUNS+APhB/yn36JHHTyu9KtFSfUroOxS7bTFFyTSGoD6i257H9Z8iY8BOeW5zom/Dv5qc7OjFQbOV7eg1l2H2vM0VanjmJpWUEK8sr2p+iZQQ6WT0UxG8lLSnGj+iwEZjM5zvorTM1wazLkxPqoYxFzlfGoh267aJmdIBLzbHjpgsBFgQQcOi4S4MqLq0MK/3m75B2EA+9eaTYgX2/ebQFSzXieUXuAezh+CdxHg7W+LT668SDbsNrkaxl4VzCbZPQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0WR8JKF0K3ag9f+yfp5STySGRPfblZE+pz5gNJHEtdM31JLMO3HLCaTv7OCmifpxFZLRPkapFWWeEKcMpKM/0z+vEgFGKzHAnz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OrsY3AXeUw+/W4QAskxLlO3OW6niIcgAXDCNPNvo4WchJ1948gXrGvu/5tKf4DaQ3dZ/eyEDQ8CWMRxRPYGkJ4H8n04oL878uArSiw/eTMAPrQQkzvy3t3X5m9/cgYwfi7PAqAOBuc03vvYQ3QcAxpm1S84522WypEIxV7GoiUKwFksqjwp+CZETHG8GS8evWSzIBQdhnPEPmfxG4MWO29HaCKapmPCHNwlleCl1c2guvAkqgzdh24Ig6a0Z2Q2b8V80kUAHb3wYFY5EKRjWOCvSE9UhsS2vG9Hn7AFkKWjOCwLRWplgSgbbT9HR1qLofwsP2ytCzUyUSFLSaQvhKa9MywLLf0fPEtU7ZMOxLyLHphAwCb8WYeDHAzVthgNTjLtpUjx4ECijB4QEGX7cRlwpfjcz4+0rbY5lHCkFqVo X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57bc458f-f444-46a4-2b0b-08dcf812d378 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:32.2515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uVluZHBicqxNKlNoYQF4tsKNkquI7IpkG7FosZvISbXdEuS0h7cp2n6RFbNucPJSReiYmObyXVXLqwnJjvj9pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4g-0007R0-Mc Subject: [f2fs-dev] [RFC PATCH 04/24] inject.f2fs: add members in inject_cp X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net The following members are add to inject more fields in cp: * next_blkaddr: inject fsync dnodes An error is returned if no fsync dnode is found. However, the injection is not supported on zoned device. This is because fsync dnodes must remains at the end of current warm node segnemt, any dnode change causes all previous dnodes in the chain to be updated out-of-place, and there may not have enough space left in the curseg. To simplify the injection, it returns an error on zoned device. * alloc_type: inject curseg's alloc type * crc: inject cp's checksum * elapsed_time: inject cp's mount elapsed time Signed-off-by: Sheng Yong --- fsck/fsck.h | 3 +- fsck/inject.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++- fsck/mount.c | 15 ++++++--- man/inject.f2fs.8 | 9 ++++++ 4 files changed, 101 insertions(+), 6 deletions(-) diff --git a/fsck/fsck.h b/fsck/fsck.h index b581d3e0da9f..51061e435f5b 100644 --- a/fsck/fsck.h +++ b/fsck/fsck.h @@ -222,6 +222,7 @@ extern int f2fs_ra_meta_pages(struct f2fs_sb_info *, block_t, int, int); extern int f2fs_do_mount(struct f2fs_sb_info *); extern void f2fs_do_umount(struct f2fs_sb_info *); extern int f2fs_sparse_initialize_meta(struct f2fs_sb_info *); +extern int f2fs_find_fsync_inode(struct f2fs_sb_info *, struct list_head *); extern void flush_journal_entries(struct f2fs_sb_info *); extern void update_curseg_info(struct f2fs_sb_info *, int); @@ -238,7 +239,7 @@ extern void duplicate_checkpoint(struct f2fs_sb_info *); extern void write_checkpoint(struct f2fs_sb_info *); extern void write_checkpoints(struct f2fs_sb_info *); extern void write_raw_cp_blocks(struct f2fs_sb_info *sbi, - struct f2fs_checkpoint *cp, int which); + struct f2fs_checkpoint *cp, int which, bool update_crc); extern void update_superblock(struct f2fs_super_block *, int); extern void update_data_blkaddr(struct f2fs_sb_info *, nid_t, u16, block_t, struct f2fs_node *); diff --git a/fsck/inject.c b/fsck/inject.c index bd6ab8480972..c3e68eb35246 100644 --- a/fsck/inject.c +++ b/fsck/inject.c @@ -138,6 +138,10 @@ static void inject_cp_usage(void) MSG(0, " cur_node_blkoff: inject cur_node_blkoff array selected by --idx \n"); MSG(0, " cur_data_segno: inject cur_data_segno array selected by --idx \n"); MSG(0, " cur_data_blkoff: inject cur_data_blkoff array selected by --idx \n"); + MSG(0, " alloc_type: inject alloc_type array selected by --idx \n"); + MSG(0, " next_blkaddr: inject next_blkaddr of fsync dnodes selected by --idx \n"); + MSG(0, " crc: inject crc checksum\n"); + MSG(0, " elapsed_time: inject elapsed_time\n"); } static void inject_nat_usage(void) @@ -440,6 +444,7 @@ out: static int inject_cp(struct f2fs_sb_info *sbi, struct inject_option *opt) { struct f2fs_checkpoint *cp, *cur_cp = F2FS_CKPT(sbi); + bool update_crc = true; char *buf = NULL; int ret = 0; @@ -518,6 +523,79 @@ static int inject_cp(struct f2fs_sb_info *sbi, struct inject_option *opt) opt->idx, opt->cp, get_cp(cur_data_blkoff[opt->idx]), (u16)opt->val); set_cp(cur_data_blkoff[opt->idx], (u16)opt->val); + } else if (!strcmp(opt->mb, "alloc_type")) { + if (opt->idx >= MAX_ACTIVE_LOGS) { + ERR_MSG("invalid index %u of cp->alloc_type[]\n", + opt->idx); + ret = -EINVAL; + goto out; + } + MSG(0, "Info: inject alloc_type[%d] of cp %d: 0x%x -> 0x%x\n", + opt->idx, opt->cp, cp->alloc_type[opt->idx], + (unsigned char)opt->val); + cp->alloc_type[opt->idx] = (unsigned char)opt->val; + } else if (!strcmp(opt->mb, "next_blkaddr")) { + struct fsync_inode_entry *entry; + struct list_head inode_list = LIST_HEAD_INIT(inode_list); + struct f2fs_node *node; + block_t blkaddr; + int i = 0; + + if (c.zoned_model == F2FS_ZONED_HM) { + ERR_MSG("inject fsync dnodes not supported in " + "zoned device\n"); + ret = -EOPNOTSUPP; + goto out; + } + + if (!need_fsync_data_record(sbi)) { + ERR_MSG("no need to recover fsync dnodes\n"); + ret = -EINVAL; + goto out; + } + + ret = f2fs_find_fsync_inode(sbi, &inode_list); + if (ret) { + ERR_MSG("failed to find fsync inodes: %d\n", ret); + goto out; + } + + list_for_each_entry(entry, &inode_list, list) { + if (i == opt->idx) + blkaddr = entry->blkaddr; + DBG(0, "[%4d] blkaddr:0x%x\n", i++, entry->blkaddr); + } + + if (opt->idx == 0 || opt->idx >= i) { + ERR_MSG("invalid index %u of fsync dnodes range [1, %u]\n", + opt->idx, i); + ret = -EINVAL; + goto out; + } + + MSG(0, "Info: inject next_blkaddr[%d] of cp %d: 0x%x -> 0x%x\n", + opt->idx, opt->cp, blkaddr, (u32)opt->val); + + node = malloc(F2FS_BLKSIZE); + ASSERT(node); + ret = dev_read_block(node, blkaddr); + ASSERT(ret >= 0); + F2FS_NODE_FOOTER(node)->next_blkaddr = cpu_to_le32((u32)opt->val); + ret = update_block(sbi, node, &blkaddr, NULL); + ASSERT(ret >= 0); + goto out; + } else if (!strcmp(opt->mb, "crc")) { + __le32 *crc = (__le32 *)((unsigned char *)cp + + get_cp(checksum_offset)); + + MSG(0, "Info: inject crc of cp %d: 0x%x -> 0x%x\n", + opt->cp, le32_to_cpu(*crc), (u32)opt->val); + *crc = cpu_to_le32((u32)opt->val); + update_crc = false; + } else if (!strcmp(opt->mb, "elapsed_time")) { + MSG(0, "Info: inject elapsed_time of cp %d: %llu -> %"PRIu64"\n", + opt->cp, get_cp(elapsed_time), (u64)opt->val); + set_cp(elapsed_time, (u64)opt->val); } else { ERR_MSG("unknown or unsupported member \"%s\"\n", opt->mb); ret = -EINVAL; @@ -525,7 +603,7 @@ static int inject_cp(struct f2fs_sb_info *sbi, struct inject_option *opt) } print_ckpt_info(sbi); - write_raw_cp_blocks(sbi, cp, opt->cp); + write_raw_cp_blocks(sbi, cp, opt->cp, update_crc); out: free(buf); diff --git a/fsck/mount.c b/fsck/mount.c index bbe29dba0f45..c2e0f1a3a9df 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -3454,17 +3454,19 @@ void write_checkpoints(struct f2fs_sb_info *sbi) write_checkpoint(sbi); } -void write_raw_cp_blocks(struct f2fs_sb_info *sbi, - struct f2fs_checkpoint *cp, int which) +void write_raw_cp_blocks(struct f2fs_sb_info *sbi, struct f2fs_checkpoint *cp, + int which, bool update_crc) { struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); uint32_t crc; block_t cp_blkaddr; int ret; - crc = f2fs_checkpoint_chksum(cp); - *((__le32 *)((unsigned char *)cp + get_cp(checksum_offset))) = + if (update_crc) { + crc = f2fs_checkpoint_chksum(cp); + *((__le32 *)((unsigned char *)cp + get_cp(checksum_offset))) = cpu_to_le32(crc); + } cp_blkaddr = get_sb(cp_blkaddr); if (which == 2) @@ -3864,6 +3866,11 @@ next: return err; } +int f2fs_find_fsync_inode(struct f2fs_sb_info *sbi, struct list_head *head) +{ + return find_fsync_inode(sbi, head); +} + static int do_record_fsync_data(struct f2fs_sb_info *sbi, struct f2fs_node *node_blk, block_t blkaddr) diff --git a/man/inject.f2fs.8 b/man/inject.f2fs.8 index 01d58effbfe4..6cf66bcbf2a3 100644 --- a/man/inject.f2fs.8 +++ b/man/inject.f2fs.8 @@ -79,6 +79,15 @@ cur_data_segno array. .TP .BI cur_data_blkoff cur_data_blkoff array. +.TP +.BI next_blkaddr +fsync dnodes. +.TP +.BI crc +crc checksum. +.TP +.BI elapsed_time +elapsed mount time. .RE .TP .BI \-\-nat " 0 or 1 or 2" From patchwork Tue Oct 29 12:09:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A070ED2AB30 for ; Tue, 29 Oct 2024 12:11:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4l-000413-7k; Tue, 29 Oct 2024 12:11:55 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4h-00040k-HE for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=H84WeJqbreBhXjnNxlITs+xU2dd7bqKtTWq9ySsC2s8=; b=GwSxUOF98onoJfn2AACm7/+chQ 6La/s4MG7fJxqCuEsxeROoY9/q7ws1EUNV1D3Xbpx9TCuY4awksNdzA2sf29DxwCfzpBTFlqSZFrt FYoFgZcKMee3AmILiseR3C8uw41eNa7VFmL9iKSh2XV7LX0N34mVUE5hivkp0xMQwmsg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=H84WeJqbreBhXjnNxlITs+xU2dd7bqKtTWq9ySsC2s8=; b=H1nj4AXdqM2PcHZhF+lGMEM8Pp UM/3PU4TzwUzVo6sbSWFELmKpvvuPEPNH3TkbfZ514qiBciFvY5FMAGCH15mdt9yG/adqXeSocgUd WiQpZsuluvVhtSSzkll1sGF5TBiyiHcJA1OitND5HP8aLqPvlpGTaU3BSLJtmQ9DZ3Ps=; Received: from mail-psaapc01on2084.outbound.protection.outlook.com ([40.107.255.84] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4g-0007Qb-Sy for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gdIdgRv8jXux2Pk5ONe4SoZJSHkREFsLQXjwAAZwqn/hznk8PbCuwQqgth2qQWlZKoRrGpJsUQe3PfPJVqXWr5TUBFd2ttdSiKoP6WPIIz2jmCujR4glYOItLz80HlrfnHwfCJOxn2Dc23PdclvYuq+OdA84uNDnwOO1LQQYwMwzee0q46z41xzeJxUAgj3nJ0a40U0I4bV0ce+iEoKWCQAqjfycloEfFo1f51iBXr+AsHfHHzP05wKlcoYWKiICBG4hrjoqrb3oErTzKX2aniEbqypSOM7LcRe+CSs7gCsewHUznYr5C/4nwHREtS3qZ9hrHdwg2Bw4zIqPFFoo4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H84WeJqbreBhXjnNxlITs+xU2dd7bqKtTWq9ySsC2s8=; b=sOELNzRa71rXzlrF3bsLZtqRbYOe9vJQJRjcebc1ENDXNg+8paE5aDxEklHMKVnWkWv2Ny4kw/9t9e/kvm1wjudsUVmB/fLzba8lwmYoYsHoDn30GbwwlGN3mS5Jae0TXFIxqLCSe5nDW9ocWxuOTa1qXwGcfR+AmcCiy90FJzeFYR81DsmjvblK9KvzdROZ2+kkRMdU0kp/LIpe25yybQFW4GkdWu3HocMcN6iqOE2Bpb6t1ZwioFciiwgD6aEqeXiajgafHLfNLSgdnO5koQu9t31pQ5oX/q36ZkV1LSl3XVqffuMRklR/RgRQ1XqnxS7lCfG8HicRJWOsoKO5iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H84WeJqbreBhXjnNxlITs+xU2dd7bqKtTWq9ySsC2s8=; b=f7UZ/kX0hDzCuKka87txeyoHPzYj8056NYQEUyh3r3P6zbmOFt/K1lYF2QkI23Ut4nXVbivYWC+eNS9cMPm7yy13yDxD3FQHjtcDgmceAVVCv+LvrvNdSGTAgN3kQEDgUiGENV2NHxAgXyWo2qS7wZupB0XEvZCBENaP8cqb8Qk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:33 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:33 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:37 +0800 Message-Id: <20241029120956.4186731-6-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a01516b-8f3a-4e47-b64d-08dcf812d42f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: Cm7C8Ggn5xtD+3SMhmqqKCSA7Ef1NZBCwk04RDyHFxjbfA+vSNHhOKoltBvDN9BtBX4uHgnQwF7QAv9lUFETzWnqG8Y0e6zH1t8rOyf9sV5kLGPO3jjCCGBzsQ9ofJiRt0FWZkzF7vhZULoYvoxxgRjea8NGF7UrRw3mH77YvWJlbPfHcQ5OTvTvuqr3iOFy7Hs1SnduG9esLmhBk4ONzp8GMx9y2qVmWLp1OJbojUJODrkjXMsKVEffw4LPqDRqh814Cf2hc7IawN5XvQlIp9XRKD2fwc7FSV2BF8HG+gmpa2p9iDakIxJfqHHdneHhDWZDi7aK00BdvDMjImfaeh8ckv2g/tKT4Y38uMDUw+w42p07n5k9teYZ/A7VFsdnp8jm6uI+jntExsn4oF5leU9DkHLlZCBcDcvpmfNaM9Pe2hM4XPR8WdpbGQQLs3riPJZzNJiO27UEueL90B3/O6YBNRaKajJWvlxFgMcZg7+lO2n5Hhf5fWS01DfdItWRZ2674ihEhcBbh1lou+uSCqnnTXGNcfLGEZQZRhjErwtNIH/hQ+janx8BejhhIMf7hYcujt0e+h2KZTLmBRuWitATPi9jeDlNdXZefYZCaH2BvwB9amhi0YFM2f9UuMRwcwZPiib/G68aC/W09vd7dawE3RFx0fxrR6DIb8uVZbuXqSCTNKLV1xMGY63LLravIDHvN6GVZY0qEy/2IbwDnsPqJifY9xrVO87jKEFpRBqbngGp+Hk8N+JUPtaE4B7rmvausVf8utrOMjXXAkHBwf8FvXGvbqL5ZgSbSv+TwDW4oOe7+BgSXNCxm2Trlp6CyGh33InmpxlPtMvz+gpTEsPHZBXAf5HcQiZC8Ysw4Gd2HpDz6CVEZ8FvWQIJinARrcjmoZMOISL/eH0M5y+0U97J9JALe9+AxpNQeveTiqgV0Ry9AJCL9dlx/Ut6pj6OMsLyFhYlqsFMqaQWRyVw1VMIntijmkIpYvwdKwqwFew2o5THv1WklhX6lOPgULoc+RxYaB4YSSYug8PdaBu7QSkK/waSDQNeIrotk4DZxNPgF6TCuI98V35l4IgUMibdcekiol9JxtXcW1DM9TFwEAPLXjRuTzfigWE7sIr20mU81q6OpUwKZDk7uDAaTRZZquXi84nUH0C5/bL2+eIyUKhBZ1joDhOJMreL604JYljNoeaOh3haGPq0tMwXR2o6lFJFHlzqrgonneYXfGZLfkVpjvoE4hzCFoYoyYVSHCAOJy27J9UhD64F4G+Ipoa9WlLxPo5heXJ1TT0p6ufaTSc8kHKDfSqYfWKBwENuKdfuBSLewyGHp+sVqkOmJVLt7ue14kL6ACZ+P5URMxLxg+6dHgAeVhCX2dKKuIxs6ww= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BENNALoVD9RYZirGzzomBgdYXhEBjd7F6oHsFjVyo/ayL1k3UCf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jfpxl47/SSNLXqbjhHnpPPan5TEBY+VhRPGKEx/9DinSOjez7LeJ7FpnqFrUtzZPn9X7K449u6EOSxKy5q+PoXgNwb7S3NHt/v+mzLtLkX6dNw27b0nycfHJDARiFd5CSy6rntBO1z7UI1CIjzRUtpoT4X9Cly/QTHEAuM4HuAVGmTnxD+cgNZYxcbS2brM1EOqTH+pNyX7+XdG44ZKSQIPLOzOoTlxyz/MT/2dRN3Wuz1gBMx2vPfgNCUIR9loxryb4keIqymJUC6Sw6GwfeJGowW1R2iXRSZgpbkrNHxhW1j2vAsR2n/lkeS/SAIdZ/pjXhb1JANByKcf6xi3+kvVdXSLTOyXsqNOaRPE6rLa2hGRZWXgAvwk8TY0ys4Cc3xRQ1Y7vbw/pQZ7GnQMqYa8taUDgj9n/9RWEybghSBULt5qBgbq03wGZFNiQY5aBZ8rVgUMwh6VXAx6DAyjEzzVKnCLVVm4Qfry X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a01516b-8f3a-4e47-b64d-08dcf812d42f X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:33.4526 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pO0gQq1PFLlb48AXBff/U69Ua9coCk+oKtdXbSzDPzUvMcZc3tkJh1F0hK2IaI3ko3X/1NMa99+lVpVHRWZ8DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4g-0007Qb-Sy Subject: [f2fs-dev] [RFC PATCH 05/24] inject.f2fs: add member `feature' in inject_sb X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch adds a new member `feature' in inject_sb to inject features. Signed-off-by: Sheng Yong --- fsck/inject.c | 5 +++++ man/inject.f2fs.8 | 3 +++ 2 files changed, 8 insertions(+) diff --git a/fsck/inject.c b/fsck/inject.c index c3e68eb35246..c997334ec57d 100644 --- a/fsck/inject.c +++ b/fsck/inject.c @@ -121,6 +121,7 @@ static void inject_sb_usage(void) MSG(0, " magic: inject magic number\n"); MSG(0, " s_stop_reason: inject s_stop_reason array selected by --idx \n"); MSG(0, " s_errors: inject s_errors array selected by --idx \n"); + MSG(0, " feature: inject feature\n"); MSG(0, " devs.path: inject path in devs array selected by --idx specified by --str \n"); } @@ -412,6 +413,10 @@ static int inject_sb(struct f2fs_sb_info *sbi, struct inject_option *opt) MSG(0, "Info: inject s_errors[%d] of sb %d: %x -> %x\n", opt->idx, opt->sb, sb->s_errors[opt->idx], (u8)opt->val); sb->s_errors[opt->idx] = (u8)opt->val; + } else if (!strcmp(opt->mb, "feature")) { + MSG(0, "Info: inject feature of sb %d: 0x%x -> 0x%x\n", + opt->sb, get_sb(feature), (u32)opt->val); + set_sb(feature, (u32)opt->val); } else if (!strcmp(opt->mb, "devs.path")) { if (opt->idx >= MAX_DEVICES) { ERR_MSG("invalid index %u of sb->devs[]\n", opt->idx); diff --git a/man/inject.f2fs.8 b/man/inject.f2fs.8 index 6cf66bcbf2a3..5196aa46699a 100644 --- a/man/inject.f2fs.8 +++ b/man/inject.f2fs.8 @@ -53,6 +53,9 @@ s_stop_reason array. .BI s_errors s_errors array. .TP +.BI feature +feature. +.TP .BI devs.path path in devs array. .RE From patchwork Tue Oct 29 12:09:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E191D2AB2F for ; Tue, 29 Oct 2024 12:11:56 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4l-0002aH-Ob; Tue, 29 Oct 2024 12:11:55 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4i-0002Zj-Gv for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jq2STUu0OPNY00syPFv7jg0CFbIHIvWx5eyZupS0iGY=; b=Uvso3qPGDi9TtI9artcAc0FbZK dSAheaGLi+Wm173oRsOQz/XsELigrunNsRHsQNqY6e5bOl9Z1EQORi8dr8TtJlFO7g6YrrdjQ2jXm ZaEpOtXpSbb5Dz7Dzp4UVoKRInxkKMmr7MFdy0OmYe6sjH9BypFAbxeGQll68uCcuibw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jq2STUu0OPNY00syPFv7jg0CFbIHIvWx5eyZupS0iGY=; b=Lt9jOAaRl/I7ak4B2OrXaOB2H+ TPDOW7rYY4kGV2QaF0wiwrVIF8GOC5VSkQX3CCOMjQqmtHPiiTemYdooeksuND826GJxRwg05RpZ+ VwDcewWtsUvj2pP/YqmugJTzuhDaWPLjCKapWkVbYgrp697m6hZknxJwoUp0zwQiJT40=; Received: from mail-psaapc01on2084.outbound.protection.outlook.com ([40.107.255.84] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4h-0007Qb-Ot for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P/lum3pPXmAQziGnyzHyBlxHmZv8cv+VW/+JNTsjz8kisXiNymIbwGCEsP5pchP3sltOWd5ZHVfDWlOU2gk7h31/BduLeAkRfLnYoeRL/wuVVyZGu04NVk6IPVrLuaL4X/8DiE5mlaHI5YtaYUkTRv3N6laoDagWf+VoWpkpFpKBTBYA4paY/VqUbYhRs2fsAGm8Jdn4WnfWpd9PGcsxpZjJNMaUFeafFkGjsO8hQfVVVIwI9oq/jldJMBYXhKg3tJBLrxbjMPParzFKvjLMLJpDlWikax2JfkffnqOJR4qYmrkhCLy/uxgNKUBNermGOXVmlOYKL6Nox1bhX0oUcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jq2STUu0OPNY00syPFv7jg0CFbIHIvWx5eyZupS0iGY=; b=pATb/tFYuIp1zZre8BoQo7OsFQNMf9DvtrLlalwuKCYgaSbd7XqEXFN7gJK2atfZm4Ex2gHye6sn2JZ5uLoNhSYLB34Pdi1iCAqrj5xVEm7sayqq79JUgG1E9QU30W0HD/SXzs4G9x3/JxNpmSY4y8SfjZCIYuG880unG1vHTT5v5jb8GVFuk0xMwx/2jsGDW63804s21z7AvOr+AVzkeX0pi7TZjkYfDzWk6DJGSfFdEYlIRzd/CuRB2CPKyY+oSt1ieAKUEvqUP4cgI6z4FRJqGKom2opap/OrnZmQIQvUCv9ngXKGnkoniN66TuCqvwPsJ3j0eDN7yKXfn1xTFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jq2STUu0OPNY00syPFv7jg0CFbIHIvWx5eyZupS0iGY=; b=vV+/7/gXqoskTEIUMnIcoGJFqKd1JMsqKMYNZtZ+EWItiODyIzcOUW9zAT/ap2HNyhUwIx5s5XHiwy8L5UM/p00c+EIFtL0KEZAaRc+7VWgQKVGibNwAi3e3NSpJyZ9cCB1Gb+Mi/YH3zmYW79f/xsUX5ww0tWcEXt0M4DvSFwU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:34 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:34 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:38 +0800 Message-Id: <20241029120956.4186731-7-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 6864158d-fab1-4766-0cda-08dcf812d4e8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: +q8tGmNrgVO/3y1mXj4bZabyO5GtpgAwgwBK5WG2n8btRX19cuVnxDOaZpB1LDnIepC4BIwwZNmcSN9UhQ01jU9Bh/v2CJTSnqaa7evFYtX5C5+WT8z4FoKagzmZBeVze5Ojjt3hJjUPB3EwIJPOI4bpzUI259qKZiRf00/T/+rLSbruW/3tJtsOY5iRowCz/sdmDyIUxX4tLyx4f3WoHCUQ6HIEIhVRCTZLKxZg09iRtDfSYAXPhXs3XbpLax5peZ92Sq7oHm1XT4r2u/ZsjHiidgA8jV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AajnzNLG1dlhqWVoPrI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q9EZBB+QaVmU3TjGbCE7SSWw3I/VLi1AupxJ1+KKoVgcjQU+GVvRhNE3X0Dn5V9AhOQyxSLTgJZTEMDsEaXHa8EsYCwAkdDBJbeRV6oegeXLw50Pl5LZx1V+X/RlVuTezIlQ3dRvm69EjK+5KZzEOeC+iNZTgQMgW1vFfXdwWrqmoJnUyYD+k937yH3npSVu7ZJus1O0sR0HOBCe/pzsrMzxrcIYsD7NDjbIM7rHRtJO51d4gFehI7KWzrCW8prPh6pz5CeO1w+cn0oHgdm9SxFDUAeph45VpQMoyYh8FIqpMeWggVyWmBPn1JQlQEQtSp5Gr8wDrHhuE2sebEEJFXQXUs/JVl5COoxFTfB6JyfmEMjB81papFmHnwbnxQVDuRKZxBXcKJyitPviRM8VB0Z0UAlBax5Ceys/B2P5GbMnZmsslhAFCqe04kqMvvDU9Fxs6EzoLl22xCNJ1pTAfCQNIpWz0yEll+NIASgH1IE+KSkSHjfEzhvwW7OkCU8nTFBbN9JsHjUOj6Kedv3QfAM1u1RcOpXbh0HqSTCjoUv2hrMznVxlfO2FKaXUS2iP9udc2Rcnh1ZKaQzrNgwQyXURng4gUNA08t+oio/mPkffibBhWBnLFyt/AokBios5hqmL3DWLmdBlr4Zd4Wtr3WwdE8VBdVYm6hG6qL/8nhid61GuOOGKqz0BqF14R1DKIiuD21JoNYAcOPFVeYqhdID2dduwFrrBlSAZWtYfQGjZshAKweJjCR8jJC5ByidTj0mQyxKc2rRgsHAe7U/vAvfChynwVSe5MYCNYdg8/0zlHDD9Bs0udTn3aWN14Ly9UtVm6ZtJxTkx4x0xnkc6mKaFOzvGLC6FndUBSPgw8Um3dTs3Di0ZeEV7X6et2hkNjt1dUD0SJQ/IwTfixXOs1IkriceeVl0bRMgUwtzhpcyuotK6WvyEIDpbQVXHfpcv1DhuFlsNuy4oDcqH7UiA8PIL9vGOq2NuNuJykmKTy0hg1+pkE9dMVr36gMgVqjT/F/F8FznRwCuYipAF75pe5j8R2Tow/BYfgipayp7Jv6VgtsYGIkPcPmntGb+NWg4UQ9sMLIB/ZpkpdXJ63uT3Kvx1Z1fUKlZhVSB+at2x1EPvMvuVL/8PMcRT/cbqeOqxLqbmuGA1GdHknobTwaVldLBsBJ4RRIf0fpJGRf+qeZ5OCDX+1Au7jFk/AGHY3r0EsRnfFb1PPjhidA+aWxRBePy2LjNgJsOUSuzoxtqmQjcyrwinqTLUL8JfVVfJ7RZlasoWT69cAzcVDznzCsjq2HW1Gv6UIt4i0iq7CQ3v1IWSQrj/UYOt/XTOzM/Ok+HdyCO7pOXAnUxDs2dRIHxQjhE/YPOEhbkTauxaitRgacRBXUycYO5meIdxPH3sENSOnQ1e3xxpahMxQ2kek0BF0aCeyO5A8fWV/CbHxufXflwb4gV3v3LfGN9JQlO7kBewCNISkFWU1mQPIRy2CCQFO8VSX1rYX/57CrlseI97TDvM+wZn7xR4QCDysmVIQnitD05bG7qelLKo1+520W4h5g5f+N1tNVaPMTBftf5RuOMFxHbCisennGR5/ZUHERGV X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6864158d-fab1-4766-0cda-08dcf812d4e8 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:34.6510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kzjbx5Mq3+0KRlc3sJu7KSEn78dLm3QC+HPJo6+nwsoNReUMz5uYQU8XW93z45UkYkCReGlSex3OHgEXmiDF+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4h-0007Qb-Ot Subject: [f2fs-dev] [RFC PATCH 06/24] inject.f2fs: add members in inject_node X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch adds new members in inject_node to inject inode: * i_ext.fofs: extent fofs * i_ext.blk_addr: extent blk_addr * i_ext.len: extent len * i_inline_xattr_size: inline xattr size * i_compr_blocks: compression blocks Signed-off-by: Sheng Yong --- fsck/inject.c | 28 ++++++++++++++++++++++++++++ man/inject.f2fs.8 | 12 ++++++++++++ 2 files changed, 40 insertions(+) diff --git a/fsck/inject.c b/fsck/inject.c index c997334ec57d..4a811b3a3302 100644 --- a/fsck/inject.c +++ b/fsck/inject.c @@ -197,8 +197,13 @@ static void inject_node_usage(void) MSG(0, " i_links: inject inode i_links\n"); MSG(0, " i_size: inject inode i_size\n"); MSG(0, " i_blocks: inject inode i_blocks\n"); + MSG(0, " i_ext.fofs: inject inode i_ext.fofs\n"); + MSG(0, " i_ext.blk_addr: inject inode i_ext.blk_addr\n"); + MSG(0, " i_ext.len: inject inode i_ext.len\n"); MSG(0, " i_extra_isize: inject inode i_extra_isize\n"); + MSG(0, " i_inline_xattr_size: inject inode i_inline_xattr_size\n"); MSG(0, " i_inode_checksum: inject inode i_inode_checksum\n"); + MSG(0, " i_compr_blocks: inject inode i_compr_blocks\n"); MSG(0, " i_addr: inject inode i_addr array selected by --idx \n"); MSG(0, " i_nid: inject inode i_nid array selected by --idx \n"); MSG(0, " addr: inject {in}direct node nid/addr array selected by --idx \n"); @@ -877,16 +882,39 @@ static int inject_inode(struct f2fs_sb_info *sbi, struct f2fs_node *node, MSG(0, "Info: inject inode i_blocks of nid %u: %"PRIu64" -> %"PRIu64"\n", opt->nid, le64_to_cpu(inode->i_blocks), (u64)opt->val); inode->i_blocks = cpu_to_le64((u64)opt->val); + } else if (!strcmp(opt->mb, "i_ext.fofs")) { + MSG(0, "Info: inject inode i_ext.fofs of nid %u: %u -> %u\n", + opt->nid, le32_to_cpu(inode->i_ext.fofs), (u32)opt->val); + inode->i_ext.fofs = cpu_to_le32((u32)opt->val); + } else if (!strcmp(opt->mb, "i_ext.blk_addr")) { + MSG(0, "Info: inject inode i_ext.blk_addr of nid 0x%x: " + "0x%x -> 0x%x\n", opt->nid, + le32_to_cpu(inode->i_ext.blk_addr), (u32)opt->val); + inode->i_ext.blk_addr = cpu_to_le32((u32)opt->val); + } else if (!strcmp(opt->mb, "i_ext.len")) { + MSG(0, "Info: inject inode i_ext.len of nid %u: %u -> %u\n", + opt->nid, le32_to_cpu(inode->i_ext.len), (u32)opt->val); + inode->i_ext.len = cpu_to_le32((u32)opt->val); } else if (!strcmp(opt->mb, "i_extra_isize")) { /* do not care if F2FS_EXTRA_ATTR is enabled */ MSG(0, "Info: inject inode i_extra_isize of nid %u: %d -> %d\n", opt->nid, le16_to_cpu(inode->i_extra_isize), (u16)opt->val); inode->i_extra_isize = cpu_to_le16((u16)opt->val); + } else if (!strcmp(opt->mb, "i_inline_xattr_size")) { + MSG(0, "Info: inject inode i_inline_xattr_size of nid %u: " + "%d -> %d\n", opt->nid, + le16_to_cpu(inode->i_inline_xattr_size), (u16)opt->val); + inode->i_inline_xattr_size = cpu_to_le16((u16)opt->val); } else if (!strcmp(opt->mb, "i_inode_checksum")) { MSG(0, "Info: inject inode i_inode_checksum of nid %u: " "0x%x -> 0x%x\n", opt->nid, le32_to_cpu(inode->i_inode_checksum), (u32)opt->val); inode->i_inode_checksum = cpu_to_le32((u32)opt->val); + } else if (!strcmp(opt->mb, "i_compr_blocks")) { + MSG(0, "Info: inject inode i_compr_blocks of nid %u: " + "%lu -> %lu\n", opt->nid, + le64_to_cpu(inode->i_compr_blocks), (u64)opt->val); + inode->i_compr_blocks = cpu_to_le64((u64)opt->val); } else if (!strcmp(opt->mb, "i_addr")) { /* do not care if it is inline data */ if (opt->idx >= DEF_ADDRS_PER_INODE) { diff --git a/man/inject.f2fs.8 b/man/inject.f2fs.8 index 5196aa46699a..691a40c889a0 100644 --- a/man/inject.f2fs.8 +++ b/man/inject.f2fs.8 @@ -182,9 +182,21 @@ inode i_size. .BI i_blocks inode i_blocks. .TP +.BI i_ext.fofs +inode i_ext.fofs. +.TP +.BI i_ext.blk_addr +inode i_ext.blk_addr. +.TP +.BI i_ext.len +inode i_ext.len. +.TP .BI i_extra_isize inode i_extra_isize. .TP +.BI i_inline_xattr_size +inode i_inline_xattr_size. +.TP .BI i_inode_checksum inode i_inode_checksum. .TP From patchwork Tue Oct 29 12:09:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37FB4D2AB37 for ; Tue, 29 Oct 2024 12:11:58 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4n-00040L-4Q; Tue, 29 Oct 2024 12:11:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4i-0003zv-1e for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gWldwuJBCpQvptNjiclGUM1IsFPz45aBP3Agxu1j2Wg=; b=VzWEJ0CGaRwhgUBDQMW2RVJlj2 LdkY1I96f0SKdKxX5pTNw7FfCQA78vlgk4XGSJGWmdmYI+K+QJH+0wByT3nlZrwRonddwYwg6UBCb nQJBs/iWRibx7yDsUn6knADu10QZzcCbhyFkbc5Yvyjy9Hp5d7sJ4nvpYn/XWrhFkB48=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gWldwuJBCpQvptNjiclGUM1IsFPz45aBP3Agxu1j2Wg=; b=lrQlQqi1U2NCbfQMvIynZa9ynl aaxATP+5gPJVKKopbSLqmepHkC0JtbAT2KPieF+ttsHSydQxfy23TZUvdJAcgG5ZrtJCVDGsygs0a K1LHiBFzxs5HRsqlbd9yjV+kLsELKI4c5rcV9zyZDo/MqOKZO+rdD4wAyYWS1wP3XPYg=; Received: from mail-psaapc01on2053.outbound.protection.outlook.com ([40.107.255.53] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4h-0007R0-PH for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BH2bo6jikxIHJmlWWwLb/avnuNzBqJAktdUQkkArY6T39dTkKlwyJJzlGkxdJ4BHwIlYZ9n1fu5IHkiWGeQEZ2dYu4OcOCp0QY5mHXdwxyxVjZ6VGstOPHxjbW3De9ZxS+FYwJwZsynPMcl60oCFDZnbWQSqZdKfylb3DhsPRhzEUWgN/hLDPtrqH8xRkv5fg2kIXC2I/ds1KtCbRGIePiDBEP0t8vPH5ASwXCjZ4ZaBy1gb36eYlgsPKQFrGbJjJBgWRbCXMaHcZ/FD8SISqPfnNtYQ+8Qjzj7u1UFlKzovwAVAwsnbAka1S8N0k0UsGnKVPxnS7x3iqfzOjlqoVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gWldwuJBCpQvptNjiclGUM1IsFPz45aBP3Agxu1j2Wg=; b=jNmdD1bhV7lJH5Ctz0AAPmIyyBUrWeIywGSLmItvetoER33iMUy5Z7CGdqq49QvtGM6WJvHwhigV1MhYSM7OEDAfPMdsbhZbvBrXxVzuRg6EKINL1buGicmxUiah6xEQdQgTdFAcLOJt97YxyBpNLrKHmM67Jm7SXp7ls2/dS8nYjSe2KvOpjB7qhCgrskFLzOAv5fZk4V+av/pcMcwYVHntsV8+o+x1GZT24GkVM2cT8eBC9laN+5yBLtPoeYYD3469oJNucKlNIHl5J4CoKFIW0Le9F4scr8+QKDhaFTYLbozaUDfHISfTYR7BWnuSxD4YKHFjBp28oE2YjC0dAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gWldwuJBCpQvptNjiclGUM1IsFPz45aBP3Agxu1j2Wg=; b=A5Hn0QAI3O3/bKlzmtZu07qtLVMaYpvNzFHZ76ww8ENM/kj4jLtbWzIBIOAg74xtZ0+oKQo4dn7ZdblzxJ5mD9m2PaOZLvNwJDgz3og0Z842TqHbYMf7Hd0190BXCqifucdI2/obu12GjkuG5tU/3NUQ2Z6mma6env+o7N4FZ+A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:36 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:36 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:39 +0800 Message-Id: <20241029120956.4186731-8-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 29c823bc-b42a-4b73-cd42-08dcf812d5a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: bE6SDPwbnZG1oAUil8bd+yoBjwIAIuYrvxDZKSf6U5g8/zHgtKKdanUMls96YK3wyFW6Lqv7RavCVT8AlcgK/ZNUl4fkItnw4bFqoKcDrQ4YZlorJRZ1bx6Y1mbr7gPHF+aLlOKEhQvVwOUbbh4QLItmuiJwy8fL4Vr0Gososb1heeiw3ALuSzfkd0wvcAifUh4cBdI0QdtUs0jsNWvE4Ax1jG9Qw3rviK5sb8TPc2WdVawErDxWR3OB09dr/QrlQunn5uV1W8L8ZVXimIvVJgNT8yaBGPtoQ34H0sdZ0MPzYHwDVtZRD5khBHMwUDy+BGq9GBWJcmJCcfwPwH4Q/WtSqqXHuivJf3UL2d3xu7L6vKTKOHIgUJZeqSXA4Am9uiVQLsUoERDiy+6/9fYW5VwfOtw4fZJkUkD3P5cwJ3pxzs5/YzKff1IPv+h7ruRdTHfAMm8wRA+AQ+cnVrFRdoRwnI3RHlmqYlrndaCIh3Da4B9sPWrAnLVV5uLBwjUjhX2M+32IM47CCGLegT4yO1r9+qTFBgxmXGfZ8l1936ROG6xrMN8CwZNuQmsWcHf+x7N6TwbVcoDido752/Iq8y44stB/UBoLTQwoLnp8ulN87O8yhh9K40fsQFGfEk3fSi6NRq+/gIuew6vjzuWiQJs5Lpex8cBIdq2f5skgNOs+DBq4pZTgnlNBLX63nhVXUAsS990GerBYkXEPrm8Wgkp64gs1N1E5owm6DZbfcqvpErgtMxJsgtTrvy5SC0/7PMLd/8OOGxLA46zN+RkaV8z+/zPrimbMD1TpkjZY50u1zJ3GYlRxFmYUWJbeWx8wNKf3MxBVONoOvxBh/ClePH+x6PLntV/ylUire+eieMIuD7CaELwSvBRSxycH0brylYppwbNDTrz41EE0XNiqAQGJGIjtiGAYLk7jus+ZAOSjgzfHop4sGqgbC+0zoEedKy9o97riNr0vJKne/RNY0Y+c2p9QwbyrinLOVdbYFIY9zWJo65gyGR/bX9amKKIqQTr/3uBq5uh10Cfv8uBO6aUKnzB4nS4hyMf+8B5vuJmBjPpfuSI4Fl9fngGGL9PE2H44on11NtIrxhqZKowro7sgIOKK9eCvVYR0R5mM2R0+Us9rqY5qt2nvvbCGnig6hFk8H70I6Qk9C1B99u46ulXJrKnxl8Cg87eWuOCKcyozqDs75LSBhTkIx5cC0NdMsikdWqalhSgP20BkWTWF6ZJq/x57m88w+OWvMIu6LZIGWg6n+s13jkwjSjTI4br2NID5vyUGJYKKHxz78T8XakYxjkr0tuvnNIjirClKrUYnHx6iKffFNxLU/y2N+sx9TJNcNUJ+AJ8HZ12tZTqmDeqU1rxEVD/UDuDpULrw0PQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2bYNssBQ04Y3iY19p48TfAfmOCoaAA4IruOcIESyJpHly8u2u/I7tbnOVY59z/A9HTeA7kSv48SX2/+V7hSw1ag426wY/5UpNkUsAzQchtFRyee13KUEURvN6BChJlDWT2tY3tTYTYPkARP/dp9VhRDmiJGnVfngfC99b7TXoeu33Lvfl5MVLN9RAPancomEajkuq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Of17gz91wXKzgjdJo1bUmFn4Ui/+MHaa5sG7iqMXcbXuYEFmgCGoPTU0vQrGrgsEX8nspp4B43c5RH9IViMXilR6bZUr8IeOQT0LrLQhPGYZAgyAgErwaxBfZd5GhT+ulutr1LE33bgQSoPEXuVRWD4FtXDU4uKTjTzri+WeWO8ahKnJeEQYJ2l/zAxX4kpIET7MoTzDLbRve90v0VC8tm5bqBrqVtTQJwAstBTXTtVRAuCWWfhzy8Ki6ZcGMzytTbl/LpEya+tyz9GpzMIWaFNfLy1/HklMB2U2HsfmqHzvHo6pJjzxEAcmE46gNfF92gQb6/kfll X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29c823bc-b42a-4b73-cd42-08dcf812d5a0 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:35.9952 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RQDm0KvOc5On7WNU6tFU0Nwu6E+Dcju15eLD+Husp7najqS3kcTCrA672MRZWm6XjhKS8FErdjhQfBCIB71unA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4h-0007R0-PH Subject: [f2fs-dev] [RFC PATCH 07/24] inject.f2fs: add member `filename' in inject_dentry X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch adds a new member `filename' in inject_dentry to inject dentry filename. The dentry is specified by nid option. Note that `.' and `..' dentries are special, because they are not in the parent directory of nid. So this patch also adds a new option `--dots' to inject these two dentries. Signed-off-by: Sheng Yong --- fsck/inject.c | 94 ++++++++++++++++++++++++++++++++++++++++------- fsck/inject.h | 1 + man/inject.f2fs.8 | 13 ++++++- 3 files changed, 93 insertions(+), 15 deletions(-) diff --git a/fsck/inject.c b/fsck/inject.c index 4a811b3a3302..bc8f09a67c1a 100644 --- a/fsck/inject.c +++ b/fsck/inject.c @@ -104,7 +104,7 @@ void inject_usage(void) MSG(0, " --sit <0|1|2> --mb --blk [--idx ] --val inject sit entry\n"); MSG(0, " --ssa --mb --blk [--idx ] --val inject summary entry\n"); MSG(0, " --node --mb --nid [--idx ] --val inject node\n"); - MSG(0, " --dent --mb --nid [--idx ] --val inject ino's dentry\n"); + MSG(0, " --dent --mb --nid [--dots <1|2>] --val/str inject ino's dentry\n"); MSG(0, " --dry-run do not really inject\n"); exit(1); @@ -211,12 +211,16 @@ static void inject_node_usage(void) static void inject_dent_usage(void) { - MSG(0, "inject.f2fs --dent --mb --nid [--idx ] --val inject dentry\n"); + MSG(0, "inject.f2fs --dent --mb --nid [--dots <1|2>] --val/str inject dentry\n"); + MSG(0, "[dots]:\n"); + MSG(0, " 1: inject \".\" in directory which is specified by nid\n"); + MSG(0, " 2: inject \"..\" in directory which is specified by nid\n"); MSG(0, "[mb]:\n"); MSG(0, " d_bitmap: inject dentry block d_bitmap of nid\n"); MSG(0, " d_hash: inject dentry hash\n"); MSG(0, " d_ino: inject dentry ino\n"); MSG(0, " d_ftype: inject dentry ftype\n"); + MSG(0, " filename: inject dentry filename, its hash and len are updated implicitly\n"); } int inject_parse_options(int argc, char *argv[], struct inject_option *opt) @@ -240,6 +244,7 @@ int inject_parse_options(int argc, char *argv[], struct inject_option *opt) {"ssa", no_argument, 0, 12}, {"node", no_argument, 0, 13}, {"dent", no_argument, 0, 14}, + {"dots", required_argument, 0, 15}, {0, 0, 0, 0} }; @@ -336,6 +341,14 @@ int inject_parse_options(int argc, char *argv[], struct inject_option *opt) opt->dent = true; MSG(0, "Info: inject dentry\n"); break; + case 15: + opt->dots = atoi(optarg); + if (opt->dots != TYPE_DOT && + opt->dots != TYPE_DOTDOT) + return -ERANGE; + MSG(0, "Info: inject %s dentry\n", + opt->dots == TYPE_DOT ? "dot" : "dotdot"); + break; case 'd': if (optarg[0] == '-' || !is_digits(optarg)) return EWRONG_OPT; @@ -368,6 +381,9 @@ int inject_parse_options(int argc, char *argv[], struct inject_option *opt) } else if (opt->dent) { inject_dent_usage(); exit(0); + } else { + MSG(0, "\tError: Wrong option -%c (%d) %s\n", + o, o, optarg); } return EUNKNOWN_OPT; } @@ -1056,12 +1072,12 @@ static int find_dir_entry(struct f2fs_dentry_ptr *d, nid_t ino) } de = &d->dentry[slot]; - if (le32_to_cpu(de->ino) == ino && de->hash_code != 0) - return slot; if (de->name_len == 0) { slot++; continue; } + if (le32_to_cpu(de->ino) == ino) + return slot; slot += GET_DENTRY_SLOTS(le16_to_cpu(de->name_len)); } @@ -1074,14 +1090,15 @@ static int inject_dentry(struct f2fs_sb_info *sbi, struct inject_option *opt) struct f2fs_node *node_blk = NULL; struct f2fs_inode *inode; struct f2fs_dentry_ptr d; - void *inline_dentry; + void *buf = NULL, *inline_dentry; struct f2fs_dentry_block *dent_blk = NULL; block_t addr = 0; - void *buf = NULL; struct f2fs_dir_entry *dent = NULL; struct dnode_of_data dn; nid_t pino; - int slot = -ENOENT, ret; + int slot = -ENOENT, namelen, namecap, ret; + unsigned int dentry_hash; + char *name; node_blk = malloc(F2FS_BLKSIZE); ASSERT(node_blk != NULL); @@ -1090,12 +1107,25 @@ static int inject_dentry(struct f2fs_sb_info *sbi, struct inject_option *opt) get_node_info(sbi, opt->nid, &ni); ret = dev_read_block(node_blk, ni.blk_addr); ASSERT(ret >= 0); - pino = le32_to_cpu(node_blk->i.i_pino); - /* get parent inode */ - get_node_info(sbi, pino, &ni); - ret = dev_read_block(node_blk, ni.blk_addr); - ASSERT(ret >= 0); + if (opt->dots) { + if (!LINUX_S_ISDIR(le16_to_cpu(node_blk->i.i_mode))) { + ERR_MSG("ino %u is not a directory, cannot inject " + "its %s\n", opt->nid, + opt->dots == TYPE_DOT ? "." : ".."); + ret = -EINVAL; + goto out; + } + /* pino is itself */ + pino = opt->nid; + } else { + pino = le32_to_cpu(node_blk->i.i_pino); + + /* get parent inode */ + get_node_info(sbi, pino, &ni); + ret = dev_read_block(node_blk, ni.blk_addr); + ASSERT(ret >= 0); + } inode = &node_blk->i; /* find child dentry */ @@ -1105,7 +1135,10 @@ static int inject_dentry(struct f2fs_sb_info *sbi, struct inject_option *opt) addr = ni.blk_addr; buf = node_blk; - slot = find_dir_entry(&d, opt->nid); + if (opt->dots == TYPE_DOTDOT) + slot = find_dir_entry(&d, le32_to_cpu(node_blk->i.i_pino)); + else + slot = find_dir_entry(&d, opt->nid); if (slot >= 0) dent = &d.dentry[slot]; } else { @@ -1141,7 +1174,10 @@ static int inject_dentry(struct f2fs_sb_info *sbi, struct inject_option *opt) ASSERT(ret >= 0); make_dentry_ptr(&d, node_blk, dent_blk, 1); - slot = find_dir_entry(&d, opt->nid); + if (opt->dots == TYPE_DOTDOT) + slot = find_dir_entry(&d, le32_to_cpu(node_blk->i.i_pino)); + else + slot = find_dir_entry(&d, opt->nid); if (slot >= 0) { dent = &d.dentry[slot]; buf = dent_blk; @@ -1175,6 +1211,36 @@ static int inject_dentry(struct f2fs_sb_info *sbi, struct inject_option *opt) "%d -> %d\n", opt->nid, dent->file_type, (u8)opt->val); dent->file_type = (u8)opt->val; + } else if (!strcmp(opt->mb, "filename")) { + if (!opt->str) { + ERR_MSG("option str is needed\n"); + ret = -EINVAL; + goto out; + } + namecap = ALIGN_UP(le16_to_cpu(dent->name_len), F2FS_SLOT_LEN); + namelen = strlen(opt->str); + if (namelen > namecap) { + ERR_MSG("option str too long\n"); + ret = -EINVAL; + goto out; + } + name = (char *)d.filename[slot]; + MSG(0, "Info: inject dentry filename of nid %u: " + "%.*s -> %s\n", opt->nid, le16_to_cpu(dent->name_len), + name, opt->str); + memcpy(name, opt->str, namelen); + MSG(0, "Info: inject dentry namelen of nid %u: " + "%d -> %d\n", opt->nid, le16_to_cpu(dent->name_len), + namelen); + dent->name_len = cpu_to_le16(namelen); + dentry_hash = f2fs_dentry_hash(get_encoding(sbi), + IS_CASEFOLDED(inode), + (unsigned char *)name, + namelen); + MSG(0, "Info: inject dentry d_hash of nid %u: " + "0x%x -> 0x%x\n", opt->nid, le32_to_cpu(dent->hash_code), + dentry_hash); + dent->hash_code = cpu_to_le32(dentry_hash); } else { ERR_MSG("unknown or unsupported member \"%s\"\n", opt->mb); ret = -EINVAL; diff --git a/fsck/inject.h b/fsck/inject.h index 43c21b56a7eb..706a211bc645 100644 --- a/fsck/inject.h +++ b/fsck/inject.h @@ -30,6 +30,7 @@ struct inject_option { int cp; /* which cp */ int nat; /* which nat pack */ int sit; /* which sit pack */ + int dots; /* . or .. dentry */ bool ssa; bool node; bool dent; diff --git a/man/inject.f2fs.8 b/man/inject.f2fs.8 index 691a40c889a0..3db3f4ecf85e 100644 --- a/man/inject.f2fs.8 +++ b/man/inject.f2fs.8 @@ -211,12 +211,20 @@ inode i_nid array specified by \fIidx\fP. .RE .TP .BI \-\-dent -Inject dentry block or dir entry specified \fInid\fP. +Inject dentry block or dir entry specified by \fInid\fP. +.RS 1.2i +.TP +.BI \-\-dots " 1 or 2" +The option means the "." or ".." directory entry of \fInid\fP is going to be injected. +.RE +.TP +.BI "" The available \fImb\fP of \fIdent\fP are: .RS 1.2i .TP .BI d_bitmap dentry block d_bitmap. +dentry block d_bitmap. .TP .BI d_hash dentry hash. @@ -226,6 +234,9 @@ dentry ino. .TP .BI d_ftype dentry ftype. +.TP +.BI filename +dentry filename, and corresponding d_hash and namelen are updated implicitly. .RE .TP .BI \-\-dry\-run From patchwork Tue Oct 29 12:09:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0590D2AB36 for ; Tue, 29 Oct 2024 12:11:57 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4o-0007zJ-4q; Tue, 29 Oct 2024 12:11:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4k-0007ys-Gd for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K9q+3wzhHhMEQR6AG32KbB7p+8mI0YvjNUs2WlLJ6Yk=; b=hX7kwsWr0bWIb6ida/kuIlE+EA eUU+mQjYsOit7I1WYQRUW0V5SDcx1xZjMa4htxUiX1dTpIPUugJOQpiQZqMUucv2IgPqNMcFeG1uw 7BkFQ30CpVIyI5t4o3TCQMLsTPc6VTt4K7XGlk9yh9IJOHTRLZmElR5ftp0JFk5R5O+w=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=K9q+3wzhHhMEQR6AG32KbB7p+8mI0YvjNUs2WlLJ6Yk=; b=KbWaIPr0vTk+IpFLAzkkoEc66G UQr/CqoqaNFurD9ywdlcAcFlE4ZwYaEn1Np1f6mODOfUiDjzwUPqzhnLKOG3L1GQbwYXICjqVdiEv ESAD+AsYGfu4hp1/+Jg/LRyLedWfJZV3TemHI2s16tCI7qJqTVjnzupvyuEGnOTUjPTs=; Received: from mail-psaapc01on2084.outbound.protection.outlook.com ([40.107.255.84] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4i-0007Qb-PE for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MMbFT78K0Ipz6+loqhVd9GrJntoFPXcFg3Tb9Uuvewq8ojXP1Yv1vPQNJDnV+KbW9HDJAaYsJ0XQZcqiLVUZq6GG6MI3sAPm9xjpwbf0rqAcCcUcs9jG+84IIMeLq3o/JKLGbEwRxSEOjdc80YMBgdHeFG/amR5yA1jtZMaNZi1PjLB3sulbrCFetv9dUnQbzhHepU0gptnaMQRfWiSl+cXRtjSXzRLl5CWrhdTHcTE3qkCTb11h/Fid50ymKdwgwCEO+JN/AD7rJL9POsHlHj/TmCAlJQ96ItR9vDQH2w4BF9qp+Dp3ASRhYuSc7gf1w6Bmswr4Rm4QFza1qGhR6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K9q+3wzhHhMEQR6AG32KbB7p+8mI0YvjNUs2WlLJ6Yk=; b=L3zLbcdLyOPyXPRHE6xIC7qakpdiPGbhw+7Qfb4jWpCKgQVPclWNxWygANFZwGeBDPJPeKSRg+P12LwEg07XMeIGt1RMMOQPhd16s+mmR3mw5FaAx7Iz+Xi68D+rcZyGN84z9wiFOyogT77TNcN9ZzsKqe+olDQHFjwGsRaCWyPp4IyN8+ZWromvkWFx67HH7rtsoXg1ZL952/RBu3ukHYB+nJbgPgcaFyyeYHhrLj0bfOi33vaZuJTcGyodBo7NT1qnPHEHCgGluTyExVq2u0x5IKNGlcG/xrNgGq9e7oOwCYdjfw9ONzNecOZ2m6GkG8PbFKRaV0g0qLKH7hknKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K9q+3wzhHhMEQR6AG32KbB7p+8mI0YvjNUs2WlLJ6Yk=; b=MrRRZZ1/Yytv2Vu7+l03kYLdos+XtL8tKMsmyoYCzYkrDsPFfG3ktuoXntPwgSwLI6wpmUELFTWmxxbwdtXFCtExYCBy8baysKUSnQn6RhYe4nKZ0xkjJwyW/hxR2sgdjVTq7rr0ioVYfr36d1Tzy2JAKz00H5JPyEKV7/WMup0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:37 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:37 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:40 +0800 Message-Id: <20241029120956.4186731-9-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a590c74-e3c6-4c1a-ec27-08dcf812d669 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: poFyDWcveHpyACfxBKveh5nxZ0iR3sGAO4TYZkf4knGc4EW3gSfQQERXf9pr+M0MMtyCH94J91YfnTshniKQto8mCp18OplTig9mbhpVZUs82CbWtLyy5Qq3LKRKY4XPyuVvPrEL8Rn+M3oJFVjiHuS55H0/N706IafpHLTHZ6twOeZ0Y1I0GwE9amIfaVzj3aXTonwU6tFLvyJZfsBpSqwYqbb5cjM4mVk3Q0GXY9gWe5mHMCm47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pHolS1fr5IUAs6HinXq/9/+2dadV7MxM1N9Jo+X4r4z9w1vYSQgUzlBue1LZAoTqoB/SxE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GCUIbfRtG5glrvxjHWd5Y0sCCx+s2BzSU2YMnrISszv2Goe2A1gRe4qdP1y495XNLd4dkYzh1Dve9mkLC9KgBVcD0PiK6kpE/tdiW2sepEbBZs0iYiPKiR7C2z6Mm8a6+CCp/tESSdFVSK5ufWUXjz1uBEb4Zk0s/t+7jCr6trRQuXrdj9mN8hDvxRN8x6+tdQknOQHB8CECs3duF7CoSE9NPlyQiPlpxdC7HPOT1pilLmb6ZbpbhD8cm64zKzHXg8OOpnSTBbIBMMm6LafjYlliKo1FFb+ag4MDMkHeXyHov/dd47J16/c1dD3O8+N3lA2754OWjWYOEK1nEt7tViRVl7ECNPe83TktPytWveWIBgs7K6nSqgvJJ6bOM2MlJOoNOxaae7nZJwLLeaWb1tP/pKGZXYbs5njoHXO47Q2bzPwUpomdGBdhBfbRaWQ8zSkTmCiO4V0LoQmU2JI2PNJkzGRSSkfBFvxCxQ0WwnpTgSXkzPV/MpZQitK+49HCIU3YtjPFi3ROYbPeyoOu4dKhSU7XyXV/FtsPOenmnmcHBsazaFzvsjiTzBlOvHz3oTExYvW6FdtVSjxLHkZiWHew3ag+dwHo9k0CuCKSfNZfsS3tdhJiJAPpT0ATK/lyV6nKAczLoptTcqEKLlFpg2GQ+rkzy6Dp3aXMZ77M9ayFgS7SAqR/VQyqwFfKjtcZgalD+nFOQ8fmhKr8mpNZ5L7WHjnNtT7FYHkoJ/o3wdlJrGT8tbluyglDjsJia0SSsaWBiwGV0iPk+f15St/sC/VsMXihwHxZY1akbRQd6fQ2tmU8GvLO5Sae8BstS8WxriqyLAmSgLql/n20CGZVAFiufRBCY1zy6gdTs1gC+LmF2DKSMKXP2ETv5I2lp5lwKYPSAz5nJ+xUzA4w2f9yJDpVP5Q1QozE/sIAlNmEwOoA+6cz63MJhIArho8RtnG/FBHA0xl1/pEF8Jcz/3a/WnH23vzuYZaK63+ffJyu9RTbsRsJDF0Lxt7EDcJYVo6aHymdq4hZCAz7RWjdJ16vklUFuGnBkYT+zSVYRYV20bEt9O6GxO7OJr1mJGX7d481waZFh9WEU5eVdjEN3PqWGFLIaHms0GHUNamyeXcrg4/OFh+5Zb40m7yW12XNnN8EGefm7s47opZHl7/tBM5vSBM75UAnrru8cE8OBzf6wEOVgzibXvnYX5nJRVvFNdmQysFm+VgvL5MbPOsuMOUp2onCjb6EYd22wSXqv+D4DZcMewq3TRlf5Zx6/lrVLl/vEtGc2ITpRso1Y3WuSJuaHolACmwQ9fUARyqKcRQFZz92ncbxe0CBimoUvvfDyA0hd49OwX0pKDabGmN9o+UNv8hPOPyji9nKsRA9O0Brft10iX14Kmj3bFPSzWsg0mjRX5cv9vLf6yDLpJUbRACmHyZNJ7C/BYKCKf2jkjwqOKPTyjJTYkeR/DofO59TiAZ1pwYd0ZK3mBskgVFvCF2j0gBXje8Kj1ZnoaqIRi9dbgKL1Anepf6spQV8UM+XDXuTq7VKrjeyp63Yl88DcLmKgX31QNIGiQtU+HsK/8QQ2mKm5QQ3EQUL+elDS+LIDiuL X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a590c74-e3c6-4c1a-ec27-08dcf812d669 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:37.1829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W02+kbBVSKfXXCCxeRIXRs0ECl/jUiDa0xTbp3O5rV5/xAFjCAUXH3lqKaiwZFYg3bWOEBAkszUVPN8VgMxxAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4i-0007Qb-PE Subject: [f2fs-dev] [RFC PATCH 08/24] tests: prepare helper scripts for testcases X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch addes helper scripts for auto testcases, and testcases of fsck will be submitted in the following commits. The basic idea of these testcases are: 1. create f2fs image 2. corrupt the image by inject specific fields 3. fsck fixes the corrupted image 4. verify fsck output with expected message The helper scripts include: * test_config.in: is used to generate the basic configurations of all testcases. * runtests.in: is used to generate `runtests'. * filter.sed: is used to remove unnecessary messages and cleanup arbitrary values. * helpers: provides helper functions The usage of runtests: * run all testcases: runtests * run one testcase: runtests * cleanup previous results: runtests clean Each testcase should have a sub-directory, where three files should be included: * README: describe information of the testcase * script: testcase itself * expect.in: expected output message an optional file is: * img.tar.gz: if some scenario is too complex to create by script, the gz file could be prepared in advance, and the operations of how to create the image should be described in README New files are generated in the testcase directory after test: * log: output in detail * expect: derived from expect.in * out: output that will be compared with expect * PASS: testcase is passed * FAIL: testcase is failed Signed-off-by: Sheng Yong --- .gitignore | 13 ++++ Makefile.am | 2 +- configure.ac | 1 + tests/Makefile.am | 28 ++++++++ tests/filter.sed | 60 +++++++++++++++++ tests/helpers | 157 +++++++++++++++++++++++++++++++++++++++++++ tests/runtests.in | 46 +++++++++++++ tests/test_config.in | 47 +++++++++++++ 8 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 tests/Makefile.am create mode 100644 tests/filter.sed create mode 100644 tests/helpers create mode 100644 tests/runtests.in create mode 100644 tests/test_config.in diff --git a/.gitignore b/.gitignore index 49809446793d..c824e8f8091f 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,8 @@ stamp-h1 /mkfs/mkfs.f2fs /fsck/fsck.f2fs +/fsck/dump.f2fs +/fsck/inject.f2fs /tools/fibmap.f2fs /tools/parse.f2fs /tools/f2fscrypt @@ -54,3 +56,14 @@ stamp-h1 # cscope files cscope.* ncscope.* + +# testcase files +tests/*/log +tests/*/out +tests/*/PASS +tests/*/FAIL +tests/*/expect +tests/meta.img +tests/data.img +tests/runtests +tests/test_config diff --git a/Makefile.am b/Makefile.am index d2921d626e48..0c9ec66d02b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,4 +2,4 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = man lib mkfs fsck tools +SUBDIRS = man lib mkfs fsck tools tests diff --git a/configure.ac b/configure.ac index 2053a65bbb36..364dd162e7c0 100644 --- a/configure.ac +++ b/configure.ac @@ -263,6 +263,7 @@ AC_CONFIG_FILES([ fsck/Makefile tools/Makefile tools/f2fs_io/Makefile + tests/Makefile ]) AC_CHECK_MEMBER([struct blk_zone.capacity], diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 000000000000..670cd373c628 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,28 @@ +## Makefile.am + +noinst_SCRIPTS = test_config runtests +CLEANFILES = $(bin_SCRIPTS) +EXTRA_DIST = test_config.in runtests.in + +test_config: $(srcdir)/test_config.in + @echo "Creating test_config script..." + @[ -f test_config ] && chmod u+w test_config || true + @echo "#!/bin/bash" > test_config + @echo "" >> test_config + @echo "TOPDIR=@top_srcdir@" >> test_config + @cat $(srcdir)/test_config.in >> test_config + @chmod +x-w test_config + +runtests: $(srcdir)/runtests.in + @echo "Creating runtests script..." + @[ -f runtests ] && chmod u+w runtests || true + @echo "#!/bin/bash" > runtests + @echo "" >> runtests + @echo "SRCDIR=@srcdir@" >> runtests + @cat $(srcdir)/runtests.in >> runtests + @chmod +x-w runtests + +clean-local: + @[ -f runtests ] && runtests clean || true + @rm -f runtests test_config + diff --git a/tests/filter.sed b/tests/filter.sed new file mode 100644 index 000000000000..ea69c8eb65a4 --- /dev/null +++ b/tests/filter.sed @@ -0,0 +1,60 @@ +## f2fs info that could be ignored + +/^Info: No Kernel Check/d +/^Info: not exist \/proc\/version!/d +/^Info: version timestamp/d +/be careful to overwrite a mounted loopback file/d +/^Info: MKFS version/,+1d +/^Info: FSCK version/,+2d +/^Info: superblock encrypt level/d +/^Info: total FS sectors/d +/^Done: [0-9\.]\+ secs/d +/^Info: total FS sectors/d +/^\[FSCK\] Max image size/d +/^Info: flush_journal_entries/d +/^Info: Segments per section =/d +/^Info: Sections per zone =/d +/^Info: Device\[[0-9]\]/d +/^Info: CKPT version =/d +/^Info: superblock features =/d +/^Info: flush_journal_entries/d +/^Info: Corrupted valid nat_bits in checkpoint/d +/^Info: Checked valid nat_bits in checkpoint/d + +## fsck messages should be kept, but some numeric is arbitrary and should +## be removed + +# e.g [ASSERT] (is_valid_ssa_data_blk: 340) => [ASSERT] (is_valid_ssa_data_blk: x) +s/\(\[ASSERT\] ([a-zA-Z_][0-9a-zA-Z_]\+:\s*\)[0-9]\+)/\1x)/g +# e.g [FIX] (nullify_nat_entry:3274) => [FIX] (nullify_nat_entry:x) +s/\(\[FIX\] ([a-zA-Z_][0-9a-zA-Z_]\+:\s*\)[0-9]\+)/\1x)/g +# e.g [fsck_chk_quota_files:2242] => [fsck_chk_quota_files:x] +s/^\(\[[a-zA-Z_][0-9a-zA-Z_]\+:\s*\)[0-9]\+\]/\1x\]/g +# e.g Info: Duplicate valid checkpoint to mirror position 270848 -> 270336 => +# Info: Duplicate valid checkpoint to mirror position x -> x +s/\(Info: Duplicate valid checkpoint to mirror position \)[0-9]\+\( -> \)[0-9]\+/\1x\2x/g +# e.g Info: checkpoint state = 1c5 : trimmed nat_bits crc compacted_summary unmount => +# Info: checkpoint state = x : nat_bits crc compacted_summary unmount +s/\(Info: checkpoint state = \)[0-9a-f]\+ :/\1x :/g +s/\(Info: checkpoint state = x :.*\) trimmed\(.*$\)/\1\2/g +# e.g Info: write_checkpoint() cur_cp:1 => Info: write_checkpoint() cur_cp:x +s/\(Info: write_checkpoint() cur_cp:\)[0-1]/\1x/g +# e.g Info: fix_checkpoint() cur_cp:1 => Info: fix_checkpoint() cur_cp:x +s/\(Info: fix_checkpoint() cur_cp:\)[0-1]/\1x/g +# e.g [FSCK] Unreachable nat entries [Fail] [0x1] => +# [FSCK] Unreachable nat entries [Fail] [x] +# e.g [FSCK] Unreachable nat entries [Ok...] [0x0] => +# [FSCK] Unreachable nat entries [Ok...] [x] => +s/\(\[FSCK\] Unreachable nat entries\s*\[\(Ok\.\.\|Fail\)\] \[\)0x[0-9a-f]\+\]/\1x\]/g +s/\(\[FSCK\] Hard link checking for regular file\s*\[\(Ok\.\.\|Fail\)\] \[\)0x[0-9a-f]\+\]/\1x\]/g +# e.g [FSCK] valid_block_count matching with CP [Ok..] [0x10] => +# [FSCK] valid_block_count matching with CP [Ok..] [x] +# e.g [FSCK] valid_block_count matching with CP [Fail] [0x10, 0x9] => +# [FSCK] valid_block_count matching with CP [Fail] [x, x] +s/\(\[FSCK\] valid_block_count matching with CP\s*\[\(Ok\.\.\|Fail\)\] \[\)[0-9a-fx, ]\+\]/\1x\]/g +s/\(\[FSCK\] valid_node_count matching with CP (de lookup)\s*\[\(Ok\.\.\|Fail\)\] \[\)[0-9a-fx, ]\+\]/\1x\]/g +s/\(\[FSCK\] valid_node_count matching with CP (nat lookup)\s*\[\(Ok\.\.\|Fail\)\] \[\)[0-9a-fx, ]\+\]/\1x\]/g +s/\(\[FSCK\] valid_inode_count matched with CP\s*\[\(Ok\.\.\|Fail\)\] \[\)[0-9a-fx, ]\+\]/\1x\]/g +s/\(\[FSCK\] free segment_count matched with CP\s*\[\(Ok\.\.\|Fail\)\] \[\)[0-9a-fx, ]\+\]/\1x\]/g + +## inject info is verifed by fsck result, so it also could be removed diff --git a/tests/helpers b/tests/helpers new file mode 100644 index 000000000000..312ecb9c8e99 --- /dev/null +++ b/tests/helpers @@ -0,0 +1,157 @@ +#!/bin/sh + +# If multiple devices are used, META is the first device and DATA is the +# second device. If there is only one device, META is used only. +META=`realpath $TOPDIR/tests/meta.img` +DATA=`realpath $TOPDIR/tests/data.img` +OUT=$TESTDIR/out +EXP=$TESTDIR/expect +LOG=$TESTDIR/log + +# $1: pre: cleanup previous test result +# post: remove image files +cleanup() { + if [ x"$1" = x"pre" ]; then + rm $TESTDIR/PASS $TESTDIR/FAIL $TESTDIR/expect $OUT $LOG + fi + + if [ x"$1" = x"pre" ] || [ x"$1" = x"post" ]; then + echo "rm $META $DATA" + fi +} + +# check test result +check_result() { + local NAME=`basename $TESTDIR` + + if [ ! -e $EXP ]; then + cp "$EXP".in $EXP + fi + sed -f $FILTER -i $OUT + cmp -s $OUT $EXP + if [ x"$?" = x"0" ]; then + echo "$NAME: $DESC: pass" + touch $TESTDIR/PASS + else + echo "$NAME: $DESC: failed" + echo "diff $EXP $OUT" + diff $EXP $OUT > $TESTDIR/FAIL + exit + fi +} + +# $1: path of image file +# $2: size in MB +create_img_file() { + truncate -s $2"M" $1 +} + +make_f2fs() { + local metasize=10 + local datasize=118 + + if [ $SEGS_PER_SEC -gt 1 ]; then + metasize=$((3 * ($SEGS_PER_SEC * 2))) + datasize=$((11* ($SEGS_PER_SEC * 2))) + MKFS_OPTS="$MKFS_OPTS -s $SEGS_PER_SEC" + fi + if [ $MULTIDEV -eq 1 ]; then + create_img_file $META $metasize + create_img_file $DATA $datasize + MKFS_OPTS="$MKFS_OPTS -c $DATA" + else + create_img_file $META $(($metasize + $datasize)) + fi + + $MKFS $MKFS_OPTS $META + $DUMP -d 1 $META + + return $? +} + +safe_mount() { + local dev="" + + # If multiple devices are used, DATA should be associated to a + # loop device in advance. + # dump/fsck will check the path of the the DATA device, to make + # them happy, replace devs[1].path with the loop device before + # mount, and restore it after umount. + if [ $MULTIDEV -eq 1 ]; then + dev=`losetup -f` + losetup $dev $DATA + if [ $? -ne 0 ]; then + echo "cannot setup loop dev: losetup $dev $DATA" + return -1 + fi + $INJECT --sb 1 --mb devs.path --idx 1 --str $dev $META + fi + + mount -t f2fs $* + return $? +} + +#1: mntpoint +safe_umount() { + local max_retry=10 + local dev="" + local i=0 + + umount $1 + while [ $? -ne 0 ]; do + i=$(($i + 1)) + if [ $i -gt $max_retry ]; then + return 1 + fi + echo "cannot umount f2fs image, retry: $i" + sleep 1 + umount $1 + done + + dev=`losetup -j $DATA | cut -d ":" -f 1` + if [ x"$dev" != x"" ]; then + losetup -d $dev + # restore devs[1].path from $dev to $DATA + $INJECT --sb 1 --mb devs.path --idx 1 --str $DATA $META + fi + return 0 +} + +# $1: member of sb +get_sb() { + local sb_cp="`$DUMP $DUMP_OPT -d 1 $META`" + local cut_here=`echo "$sb_cp" | awk '/^\| Checkpoint/ {print NR}'` + local sb="`echo "$sb_cp" | head -n $(($cut_here - 2))`" + local val=`echo "$sb" | grep "^$1\s" | sed "s/^$1\s*\[0x\s*[0-9a-f]\+ : \([0-9]*\)\]/\1/g"` + echo $val +} + +# $1: member of cp +get_cp() { + local sb_cp="`$DUMP $DUMP_OPT -d 1 $META`" + local cut_here=`echo "$sb_cp" | awk '/^\| Checkpoint/ {print NR}'` + local cp="`echo "$sb_cp" | tail -n +$(($cut_here - 2))`" + local val=`echo "$cp" | grep "^$1\s" | sed "s/^$1\s*\[0x\s*[0-9a-f]\+ : \([0-9]*\)\]/\1/g"` + echo $val +} + +# $1: blkaddr +get_segno() { + local main_blkaddr=`get_sb main_blkaddr` + local log_blks_per_seg=`get_sb log_blocks_per_seg` + echo $((($1 - $main_blkaddr) >> $log_blks_per_seg)) +} + +# $1: segno +start_block() { + local main_blkaddr=`get_sb main_blkaddr` + local log_blks_per_seg=`get_sb log_blocks_per_seg` + echo $(($main_blkaddr + ($1 << $log_blks_per_seg))) +} + +# $1: blkaddr +offset_in_seg() { + local main_blkaddr=`get_sb main_blkaddr` + local log_blks_per_seg=`get_sb log_blocks_per_seg` + echo $((($1 - $main_blkaddr) % (1 << $log_blks_per_seg))) +} diff --git a/tests/runtests.in b/tests/runtests.in new file mode 100644 index 000000000000..d49634752d42 --- /dev/null +++ b/tests/runtests.in @@ -0,0 +1,46 @@ +#!/bin/sh +# +# run testcases +# +# run all testcases: +# runtests +# +# run one testcase: +# runtests +# +# cleanup: +# runtests clean +# + +# clean temporary files +if [ x"$1" = x"clean" ]; then + find $SRCDIR \( -name FAIL -o -name PASS -o -name expect -o -name log -o -name out -o -name meta.img -o -name data.img \) -exec rm -f {} \; + exit +fi + +TEST_CONFIG=$SRCDIR/test_config +. $TEST_CONFIG + +# $1: path of testcase path +run_one_test() { + local subdir=`realpath $1` + local name=`basename $subdir` + echo "Run testcase: $name ..." + TESTDIR=$subdir + . $subdir/script + echo "" +} + +# run one testcase +# $1: testcase path +if [ x"$1" != x"" ]; then + run_one_test $1 + exit +fi + +# run all testcases +TESTS=`find ./ -type f -name script` +for testcase in ${TESTS[@]}; do + subdir=`dirname $testcase` + run_one_test $subdir +done diff --git a/tests/test_config.in b/tests/test_config.in new file mode 100644 index 000000000000..b4249dc26179 --- /dev/null +++ b/tests/test_config.in @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Test configuration +# + +check_executable() { + file $1 | grep ELF > /dev/null + [ $? -ne 0 ] && { echo "ERROR: $1 not ELF"; exit; } +} + +check_diff() { + diff $1 $2 > /dev/null + [ $? -ne 0 ] && { echo "WARNING: $1 and $2 differ"; } +} + +# path of tools +MKFS="$TOPDIR/mkfs/mkfs.f2fs" +FSCK="$TOPDIR/fsck/fsck.f2fs" +DUMP="$TOPDIR/fsck/dump.f2fs" +INJECT="$TOPDIR/fsck/inject.f2fs" +F2FS_IO="$TOPDIR/tools/f2fs_io/f2fs_io" +FILTER="$TOPDIR/tests/filter.sed" +[ ! -e $MKFS ] && { echo "$MKFS not exist"; exit; } +[ ! -e $FSCK ] && { echo "$FSCK not exist"; exit; } +check_executable $FSCK +[ ! -e $DUMP ] && { cp $FSCK $DUMP; } +check_executable $DUMP +check_diff $FSCK $DUMP +[ ! -e $F2FS_IO ] && { echo "$F2FS_IO not exist"; exit; } +[ ! -e $INJECT ] && { cp $FSCK $INJECT; } +check_executable $INJECT +check_diff $FSCK $INJECT + +# config of mkfs +F2FS_FEATURES="encrypt,extra_attr,compression" +MKFS_OPTS="-O $F2FS_FEATURES -f" +MULTIDEV=0 +SEGS_PER_SEC=1 + +# config of fsck +FSCK_OPTS="--no-kernel-check -N" + +# config of dump +DUMP_OPTS="-N" + +# config of mount +MNT_OPTS="" From patchwork Tue Oct 29 12:09:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF8E1D2AB31 for ; Tue, 29 Oct 2024 12:11:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4l-00041E-IU; Tue, 29 Oct 2024 12:11:55 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4j-00040t-PJ for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9gaeeyoWSMZw/seYyRPGWc2ZHsFetQXQ8xGniI8bokw=; b=ISKGlVsGGW4+3HEkfZVD8GjMzG DaxHouwyVbpsByBjSwoNQhZk3TCegGRutBzyODwHN3dDlg654DUtuHxik9zzQoM7mw02aOvrWi94H xf1colhPaw++vySPZMgM20W6cds9mSYUl2ytmnBhafElv9K8entsDvQPpt7vWVfirQ80=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9gaeeyoWSMZw/seYyRPGWc2ZHsFetQXQ8xGniI8bokw=; b=PZrYP3daitlm0lw9YKce5TnKu+ mUiyGMnC0WdLO3wEfg8lh2OLmj2DGT13cfj8GULd7AJhz90Q4A0TKtNXRchPn7I/971SjlSXsDx0I MUOi2puO/kdcWN+E9aR/k20BjXuSItsvV9VR6yS6ZChFk1eU4m4hYZmFpNurU8Xl1/Qo=; Received: from mail-psaapc01on2053.outbound.protection.outlook.com ([40.107.255.53] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4j-0007R0-1Z for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PN9BZ2FAIHme21stJOevS37B7QIUPaO24HKWYFp8L44tkicxIyeJQh/OAifBWlFURUOpj+yNVZZDyKDl4AZsyFpkgOVSTDQ5UPTso7XjkgCXuWLDLPFn5qsKxxPPwOxVrihSZLJCMg1xsFZYSHwTVr5o2imwDd/bLiLuTePmuEjNe/xrrqPSaSwXTb98LSzATQtH7gk4zEK6gkUbofYzQRVQ5NVjDQXjC75Sb9WqHHoNuUBJ+t6xrRMiwTwqCB8bLICt8mHZL380sYIi/GnsPb+FWfs02PEm2oJfPCEqLSB5MsbH3cmOSPXHYwy6QMltIssYGMJ75KVhKxChSjJSPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9gaeeyoWSMZw/seYyRPGWc2ZHsFetQXQ8xGniI8bokw=; b=Ih75bhI5g5MFjelGookJ2wkjDjpnRNxM6WMo5gU9L68z6+Ck4WPrSkQ+mMsDrobFB2cPPPqBukDHUUNGaPccaLsAoZ1DZvQ1yyV4Mrq6MoiHpNEd/aG8MZq63gRZwT8dFxvHY1AX7d6vphvfrEKN7I6o46ymlgk5JfItOcipLU5Yy9qoKtMvRsrvi6N0koYU1ooXRagbx4s4GxSzf3MwU7nX0Ddv0qKi2NZ0gnmKgdq5jAhiSRFjMoQpC/vOZN9YXfxvmf41DQ1Mkk02i1M3re2IqQ9mhmuHguPJe9SjEJoG9+S16R8zcqXlPorWMWjP70Uzd4O/oQ6VdDfjVgL5vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9gaeeyoWSMZw/seYyRPGWc2ZHsFetQXQ8xGniI8bokw=; b=rqZ/+qUJ6l7odIx6ZP456PXJ+txkZX+ckyuV0HCJ8/X8vnlCxRUCkNBQRO/TVvw5/mjnLUJv4KHW1nZddp/cctMJFsBgdw0AKWZcp3kb4nJPY5X4P17B4KZZEzF2te6SFEkaNAj5UKjf1A+sDHvL33nK1I3fzIoDIb87+xIos9E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:38 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:38 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:41 +0800 Message-Id: <20241029120956.4186731-10-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 530ec866-453c-427e-4102-08dcf812d71e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: zd9qLz0AQl1VYqVkf1Dy3drsMLEntmM4HsNxc7abyxAl7LEO/+q92OIVASiSCeUBPglIZMcWMDvFTmd9d8bI4OS+i79BbuGTYDqcdMc4gaaaOQqkvYQAQeWLzgvxFj8/eYOa7fa7Tj1K97pWh3ty/Z1zbCvTqe6agAeyZ2WGa8UKLb/hokmqBj480rvUc2QkVy1XavR+edItGKRJMubfq2RsoVqoIIwwIq5T3OuLsbhY85gS5dEgYpzjY2lREtm91G+lVGeGUNwoh/bXTVW+1biYmKYeSX+/z/0rSvodZOTm6CPAlPtBbrsKZrCN6lGvVOXPD2HVFH8r7nEOfjVjC6Zf9idKZXn2n2AAqIn1sXFph2nJX2tEOxaJ0SgoNuh0Qtpnkx7jLSPF59StxgdYz43lSrzFAH3jngMfBZvomps2dswrFx6dCGdWpEgYJDry8zPgx38LMfsfPdO44hoQby4BhqEZTNcVzR3EXmgZvSh+yV3s+w8stz5D/DBQX8cg+fEYCbaCY+uOfwaMloT/fXhYb66dhwjR62L90tBQSGGFLYmQwsZNpRHpkcgHYRnksYkzX/Hy5UTxPdJu7bBBR18krQc1GccaWzxHMhUmjF3WcMGt4SsoEtMAgSOBk8j5JBDd/kxKy9oEyWvwgP23ScyCyT9NKANYYSZYjTcYwmEgVF2iYF/sQWSeiW2yaLkIv32eyHwU2VHvOKxJD+MDSaxS2noC7zW3h9W7chBoTtEL+jHpfLRKR9ljBikfRAzZI4gxSavikSYgco74Q0uM5CL+vlh0bkVCKxjyLjS+3jTvXVjP4sUAN6B22+N1duyJAozF54rFdFAWoATwEHrWYgVDnFikMAo58jOgxrgfpmarjopSfwEexoKRv/4V8p6ckjPEe0qfdvfviCj24Leb6omr2oXca1aDO+RJaFGGkJXq9oGgqdzptv2b6lxlhxRO5sjfYTrgviCq+hOodsmz2PIkJD3IRPoIBCuahRTiO6tACTPDVW63nNo1OEUPnzAfIU/o2rgqCVTL2GHUiPbQe5wb4IQKCmpd/RfoMaKrsbEGdSB2vAPnASeMd7o5D2O5hMDtsfjBKD+RLWPEcNwPxEmMjsL49IBk9c8Cfqtfq8ZRiFlDCeFmgivDgbVMxjeGb7Xv8sp2c7qoxk7ezk7dcgHqnEqOsav2gpaE/rZ3pYQP498SxI4OiNeyC5k4ck3WjPehBihYtUYijGMjBxRaG6bOybFLnTyt2F8w7eJPQFNdVBXT7rrdSUkv4hrKTmhnIpZ4Z3KKQkBiTSeqjbtjx1rpuABMDXttkn2/DAWM/fGfE8VaiUQm5NzLOxQe1UOp6XUktQrfoM1thDLJJUOzp42OV/Ze6Qmbe8KXWcYGmfE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PDAa2F0peeZe2tKnyLlX0VkJaQlQMUkHnSxwCOpexHQnpIBnqzkm7M6ZOH6kQ5cdOV+nkAvNDJH57TTZgRPMiDjEMfB6Gcoa3T3hlLzqedodqNvOlyXGTXqFqeVsakscidbABHt0A/CwT+QiOUpQ8W3S/jawZKtFm62NNWKGT3+wvknzw+xAp+IbJqG/dBOu48kagLMX8kn8AmXUPfbzkmVapXEV8jkYmsE6MBXw/3+dHHZ8ksIJCkpS8w+clpq3i3WDTy6ziS6E7YRqII4Wi1Kywm7YBq4oXNeRUAYUotrWml4jW2PKf3mWVrj8gcsH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M2JTCtJ9sZuHRCv44d1tggIjCyssr4WnZaweZHUrNeNJY2bhJCtdxYX0rhr12KZPdQ942jN/2JFQOIFNvae8VUxjI4MfG0DyLhshd5vxSaaE5/hdQNDyOoWms6AF9vfmUFmiFbyEJfQsaA1CxzswGPlwCO/1IMRa8tNQ99mQrccbMKnh92EH3N7xvkuF9+l9Hq+5KFwTEUXui/ X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 530ec866-453c-427e-4102-08dcf812d71e X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:38.3888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: unPTg+I99cRFmytBNWfKrwWZkZOyFxps64g96rxR6ELn8/w/q0PYYo9fwP2aUF1XCjMf+Zwcwq/SefFxl4FrGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4j-0007R0-1Z Subject: [f2fs-dev] [RFC PATCH 09/24] tests: add fsck testcase of fixing bad super magic X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_sb_bad_magic/README | 3 +++ tests/f_sb_bad_magic/expect.in | 40 ++++++++++++++++++++++++++++++++++ tests/f_sb_bad_magic/script | 16 ++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 tests/f_sb_bad_magic/README create mode 100644 tests/f_sb_bad_magic/expect.in create mode 100644 tests/f_sb_bad_magic/script diff --git a/tests/f_sb_bad_magic/README b/tests/f_sb_bad_magic/README new file mode 100644 index 000000000000..a8887ebd2dfb --- /dev/null +++ b/tests/f_sb_bad_magic/README @@ -0,0 +1,3 @@ +1. create f2fs image +2. inject magic in sb 1 with value 0x12345 +3. fsck fixes bad magic by copying sb 2 diff --git a/tests/f_sb_bad_magic/expect.in b/tests/f_sb_bad_magic/expect.in new file mode 100644 index 000000000000..7e2d55b10d5c --- /dev/null +++ b/tests/f_sb_bad_magic/expect.in @@ -0,0 +1,40 @@ +Info: Force to fix corruption +Magic Mismatch, valid(0xf2f52010) - read(0x12345) + Can't find a valid F2FS superblock at 0x0 +Looking for secondary superblock assuming 4K Block Size +Info: Write valid nat_bits in checkpoint +Info: checkpoint state = x : nat_bits compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x +[update_superblock: x] Info: Done to update superblock + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_sb_bad_magic/script b/tests/f_sb_bad_magic/script new file mode 100644 index 000000000000..3fca2b66b383 --- /dev/null +++ b/tests/f_sb_bad_magic/script @@ -0,0 +1,16 @@ +#!/bin/bash + +DESC="superblock[1] with invalid magic number" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +$INJECT --sb 1 --mb magic --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 734BBD2AB34 for ; Tue, 29 Oct 2024 12:11:56 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4m-0002aR-3u; Tue, 29 Oct 2024 12:11:56 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4k-0002a4-Op for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xq4pN+uvzWSi8xNo4irA6tLUxKSWf/glYr/mQAEgsVs=; b=CI1fBPpokTuNhXS5A08vzjtiEo 9IWP3wBlI6mtskF9RzX7yu1spNCTPuYXjPxvzaIKjn4PIcjWfP8qA1+qwNJelNxNuBFNN+7YlTqGy W23buBVWKA6LhIXrrJbRwhsvwlbSNueC52rHvU1cfC3zlXedLJIS8KYKvi0x2F5FaH1w=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xq4pN+uvzWSi8xNo4irA6tLUxKSWf/glYr/mQAEgsVs=; b=FD93fiuGL+8te/uExRlPzspG3k 8sY1b9EtNzUwsnn1BpjIhZPVcP3532CzmvQFgcCUjRATZd0QoFwNpyRmi83G1JlQ/oyNKnKXgZEJ5 Xq03z+KydX38IBWjRJ45aLxLfRNMtrv7ziqEgrVruex3qiLGr1Pc6olXT5i0jTQ5cEfE=; Received: from mail-psaapc01on2053.outbound.protection.outlook.com ([40.107.255.53] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4k-0007R0-1F for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eo8kNqwtsp8rCCCS/p8HjMZKpiqzlX79Yifll8roOi9UxTK+2fORLDNngKsNBA6zL4eFb37v3PCyPMTvuh8CKQRmRoDsS6qPwtI2GTg/a6aXdvVVSGGc+q1worceNou0HzMwHNLBdVoGNDcsPbw6FRAZ0YlUwAl0ifhI1kWNDj2+N1QS/lLq9LFD1rwf7Owefx/SWZB3VRSq85PnPmb+My63DxTk7MLC6BYciexY8q79fvub/J22DeuNbKROQCk3Uq0TdaMvl9TczevNGbgesOwTcz1FZr37rZ43KObsnNw1ILEotxDvkWzqy+1kt8DSKFfgPIaRt7Ny8pFEqDh7lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xq4pN+uvzWSi8xNo4irA6tLUxKSWf/glYr/mQAEgsVs=; b=kLAx/PR2mM+GqHA6fO6fDRUJSkmMqVJIKeSDjGdVbWWdi7bGAUikTsKeC2AG+Oy5Hyx7nDBSinILbdf0in/EXiwt8JJ47Qq7tfbPvzychzII9fDhgyR2Ce6WXk2k7/pBZbvhN5Jfz8eXFOpeB4HVxGudgtNx7gHmQ77EIcy4Z4IpdULQ4hsKiXb4VH40A4FLMHNikluu2Sa/MoTbaRFj57RSlBNHFZB8s1ZJ/kDBbRaxna9igagFpepO6VBmk1GzCxtK5gUvLOZfcoLIdxTWhhHhIxtd/vjVotjjKKxIOIgP6ZFSPlEcRalRVC7ycEZgtTpZodgbF3hT2eMxUjXiuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xq4pN+uvzWSi8xNo4irA6tLUxKSWf/glYr/mQAEgsVs=; b=NNY3W+w7WrScwk1kOFwfO00a0e0YCE8o1WZb9r7UbAhTDozupmJ8LsjTr6Zk6eiY4HI5pgBnWSkFMrARWQAa7T5vMAhasMNUzL9zqTxdOKRmp5TTpf1nB2vdvsaSF7PMBrdnDuFhA29tBSzxNBm+ULmafjLuGNY50iuabCedTnA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by SEZPR02MB7326.apcprd02.prod.outlook.com (2603:1096:101:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 12:11:39 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:39 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:42 +0800 Message-Id: <20241029120956.4186731-11-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|SEZPR02MB7326:EE_ X-MS-Office365-Filtering-Correlation-Id: 52c1033c-a08e-4e2b-71b1-08dcf812d7d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: IbuKO0kDlY+yXIZmg8n1f4IMBUlQYQQY8H/1o76OdIfyRoIjjhTWL7HDVa9Xbn8aH2vKqddX0c9JEyOkdtgonryK9mNeyhE9JniVFkny+k848r09bUNFEIsiE1HLH5BxcZ9bBndwT3WG7j+LjDNB0P9sDmbu+5XFiAxlZ3Y38AlDC9YKEZ50cdqPGO2zo/q68NWoVEFRzdBsAWxrfeRgIYlMIMqnipC27+QQJVe4/68dHgJd1vOMu42OCZ41B9jc3CwfRq5RGm7xEkUeQuc8U8qsvcqxfrvVTlb7WbiUpTKSH19KxgQsw6GUWkOJ+Fy2eRLrh93MPPulukbiUqpFcXdnAYddGa3zy1RFiLp0ydi4+NhlVU8WiMRCbOZz3iP8lTbwjxDH6PZ6h6yIPmDsijHPjHAmDLo1qe3kK97fsodmpizKMIX4mZ1u4/ygtCS9nhVqejBIFhM2/t85OCMAVMPK3WqZg9VhdBodZqN4toU1CmF/lSCBHPjqtD/ppfwHhtEBuYuRerKjxIoPNNQG7Ko689hEviv05yrcaJPoSJDirLGAWrg+FzPvNcYvxN+CmM0mMsZAFQjiKDr4jS+HsVvJUvSvCbKpzgRE1kALbmBzGksh4TjRit5mEwLXR9bFc2ZNmXUsCY8deNR1LXfuIESWnbPszXXo29iRnJ5CfKpAmLSv4HzNlCKjmIfDbIuwp7SGkIk03Q58xLxL5vCxCjunvLKmap2PaV14iUjyjgmYkOAKjrhaiMtF+IAf+4S8Tdtx6Hik1kqlow6UE0W8ok2bSB7oDdhJiFfxp6AtNT5ptlZtYSloRTcnb9MfoVgdOK+ovD11Be/vxkoH3De0xHaKl1ADbmtXHectdMdAwsFSEVCZAYT/njvikx0g/fAHb/l8+p+HioZaDpvEemExPTxxk9EfggC9mFixeKJviWevL+zWrvLPGLH84awhr7J9dq+IzUIvbB+1goZgglJFbods1T6lQLZRZKLJYtHxQik0atLQaBI5h3Vq651kY4zyL8/vvHRmMwL2x+4tJ8Yz3iOONainF0L9g+EBfBn14f87bXyuWb2fiHG1bj5HIwKwInfowOjGac36Twc3rT5VQ/oUcLPMQkbOWVTuTsNIwfzJNNEHlY6jCKvPFarrpy08CgoUN1kQ+WGTbUqACa7PEAYqnxRvgPCK0spy+30/zZueNXXba/D7Rt2QiLMFLKIJcbo8xmK3ITlbnsMDgyRS0TwW3On/2Ip8NDzCEyxO/7+IaO4TRFY/yYbhDj+ZvO1r7N5uhc5g0ZSwtCdtaRkMU75/gHyRRE8Z+qyBjo7NHB2/bdTqdeLN8eRyU1abegi5jiHV7Sa2IeZboC9SP+uEf6FzL3SbYBAZgu1m0Gp+Ehg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jlPSYSuJ+2M19PoEbg0ypkdNxZ/jjyuQyAzps3J8LitZ1yF/wkmJH2nYh1vHm3lqKvXOckVXyC23cgk2sHCmZN6FPKlcfArIHxbJN1GU+uykbXQ8xdTZPjQ31mPS6/p4N/UXSawGBmZpWoiKewqAx8A/MmEaEEamryv197zhM3k6aGiRtskWUvai0UfXxBiTu3s4XniTqFO1GMhlq5Zh1YxnyFGZTrg+SOciEPY+ouQcLbDHdjp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6PdP1nDRnV91BOUB7CciIjHu33LoESkzWahFuCDpcCyt+hctNVbxlrMwL7OR4MeEsGfv6JIqDL6K2ml+wHwQDVqqxhxDOm4MBmWK3PLl5ZoB3nErdtgIRXYfM9yGQVKSZVo0rg3P1OXzIMWFvNouLdC9e9KCxQQkm6/9q/IJbrzzoW4S3VMO4b+6qT621sQXABHf9KqHg3Y/HfAGkPxxWtk7XfKi6kVVElWNVHSF1li+FYx2SbikltsTJVMNwLmPHBzKmjLaDdhoip4j X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52c1033c-a08e-4e2b-71b1-08dcf812d7d8 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:39.5840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XCSbTV4bHUy5Y6CEw9mKmNK7niEWzAeXwkThj22iNQrySZfU6b/fO0SRKJpZN+A2TpPwsO2dEqH1eprYbFidnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7326 X-Headers-End: 1t5l4k-0007R0-1F Subject: [f2fs-dev] [RFC PATCH 10/24] tests: add fsck testcase of fixing errors recorded in sb X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_sb_errors/README | 5 ++++ tests/f_sb_errors/expect.in | 59 +++++++++++++++++++++++++++++++++++++ tests/f_sb_errors/script | 23 +++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 tests/f_sb_errors/README create mode 100644 tests/f_sb_errors/expect.in create mode 100644 tests/f_sb_errors/script diff --git a/tests/f_sb_errors/README b/tests/f_sb_errors/README new file mode 100644 index 000000000000..df118e825aac --- /dev/null +++ b/tests/f_sb_errors/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. inject s_stop_reason in super block +3. fsck -a detects error and clear the error +4. inject s_errors in super block +5. fsck -a detects error and clear the error diff --git a/tests/f_sb_errors/expect.in b/tests/f_sb_errors/expect.in new file mode 100644 index 000000000000..ea93e95c8192 --- /dev/null +++ b/tests/f_sb_errors/expect.in @@ -0,0 +1,59 @@ +Info: Automatic fix mode enabled. +Info: checkpoint stop reason: fault_inject(1) +Info: Write valid nat_bits in checkpoint +Info: checkpoint state = x : nat_bits compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x +[update_superblock: x] Info: Done to update superblock + +Info: Automatic fix mode enabled. +Info: fs errors: fail_decompression +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] +[update_superblock: x] Info: Done to update superblock + +Info: Automatic fix mode enabled. +Info: checkpoint state = x : allow_nocrc nat_bits unmount +Info: No error was reported + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_sb_errors/script b/tests/f_sb_errors/script new file mode 100644 index 000000000000..664e4f6f49fc --- /dev/null +++ b/tests/f_sb_errors/script @@ -0,0 +1,23 @@ +#!/bin/bash + +DESC="superblock[1] with s_stop_reason and s_errors" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +$INJECT --sb 1 --mb s_stop_reason --idx 1 --val 1 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -a $META > $OUT 2>&1 + +$INJECT --sb 1 --mb s_errors --idx 0 --val 2 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -a $META >> $OUT 2>&1 + +# both -a and -f cannot detect errors +$FSCK $FSCK_OPTS -a $META >> $OUT 2>&1 +echo "" >> $OUT +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D024D2AB38 for ; Tue, 29 Oct 2024 12:11:58 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4n-00040W-GH; Tue, 29 Oct 2024 12:11:58 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4k-00040A-6L for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YuEjuxLobaTvyfQkV99PVdX4wNmQANwWNPnrhHLxbLk=; b=WxtgNufLLnsS9bx5wS8A0+apX4 /jYc9otgxTOi3nwg/DQtKrPwHf/LCQLvt4JnaBGMrv0fm4S8PMOma5vY9oEBknPeux/rat5Rx0Gns YG3/NUNIvMCZDmjauBoepW1XuleBtTMGw9XCcZyW02pXeO5KsBkLelrtcfD0sTKp7vV4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YuEjuxLobaTvyfQkV99PVdX4wNmQANwWNPnrhHLxbLk=; b=U5UqfTwws7qQur0jSkDSHf0WHt qNeYJ1x1u+JDd9/0z+m7MIZ1u0amNsU9Y6LEHOYy6Etv5CA2OIEr0GsRTI5fGzt4NQc/3JTizt3iT ozUNGVhIy7NftVcU5fcZ+oKb+MiuGOoxJs5uNe1seeSSZ+piBDgrTfJIlRABRNxi5HA4=; Received: from mail-eastasiaazon11010001.outbound.protection.outlook.com ([52.101.128.1] helo=HK2PR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4k-0007RS-6G for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:11:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kcx/bF3rL/n7YKdoCvyOQmpY9rcpUAI9YFbPDAiueddUkwPybptIRY0+P7XEdySAwxBQECz4Dfk7ATGELX5+FaODHARRpywMrA2InFl08Jut0ffQpV6A+e4HKUQlfDpgoDH6aJ1rd9x5/7tzRM4khxnFWh5sVezROlzJU1V4ywGOLgVd9tkw/1qHr4P9mAsgmPvdwg35ex0izTgVdRD9/cLSq/bLlq7wViV0msFhVtYKKbeDPCZkwgPoIA18X2N7m/7pPUt8kjUG+UXRL6bTWDmHGXnEZXtG5AzwRzisjbFD5K/DcoHoc1Xa4e/PG9f7RDfbWJf3DTYKFjG5xkZBUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YuEjuxLobaTvyfQkV99PVdX4wNmQANwWNPnrhHLxbLk=; b=Ks465ZNCv3lq99ToqZurk9MR5K1ZgNCBDqoPLeZvuj8zD8CYUUZBpXsCtWpjQI8Yqe1z8HmmWbSm8k4MPtXVu+mU5ArCMkbw8pTCUyz7wssU1wdIJqgGPTtJhE68kGxcE4aWDYaMz4MFGI97DDVWyQFBXaxfZY/AArcQAUDtg4nqdbKqMONQEbYSdf2L6iVmTilM0TVwZXHGY/ZioCNli0Zy17Gpx7Fcss/NvyYmSdbzky1EN6kldcY+Ym78XCW8t7xyuH3rMfmieopOvmiG692yJa+HXRi1zCADuWaGv+iRAHczokM2iC0Y8l8lEl2L5hmbkqtDJazMi1HP6ZAk6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YuEjuxLobaTvyfQkV99PVdX4wNmQANwWNPnrhHLxbLk=; b=EQG0KwqDPppytQ/akpTN9KzZ+7tQm9DJFVgktiuAlZcPMXNgV3VuQPjt/uNxto0fVISxB1fCtQULVwlAxrEZUBP605az4MlkzhPRjYaP0U+zMdyzN4N/UQpqcpQPD/s/Qbabnwjt6ipLbJxyO3lsCP1IRYnrd5VdvTq5bHOsgq0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by KL1PR02MB7877.apcprd02.prod.outlook.com (2603:1096:820:13e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.28; Tue, 29 Oct 2024 12:11:40 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:40 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:43 +0800 Message-Id: <20241029120956.4186731-12-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|KL1PR02MB7877:EE_ X-MS-Office365-Filtering-Correlation-Id: ea0c7792-ad61-4d1e-0fad-08dcf812d892 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: +4sCJg6J01INyejJGz/1JgAToJc/mVBaN3UR4rwGc+6Hru01krvSCHTXetd5VPRXt9OGP4b8C5JI3J+YXrjD4OqYFKQUDh4HzYKmbRxdccblBxmK1Q5a+yGlDTLwLyaWoux9DPrCQrlqD40datQkgr+/m7N+4SchBuhmKINvDmhf/C6zoOzyF8PgnGYB9g4wGiQI9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CWEUpn4bqLH4RcRPyfA8PBSe99RgsvZCZIbEvDFoxjFWtJk8UhzPxdBn6oL2XAPJdEjvNtamp15thYKlyKgDEz/eZQvDVoLlGjh79tnrjUB6raL64QQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fkrrdV1IpILxBICzviDpl6dfNSnieD7XqogKOmKWK466QM6qbDM6ou/+WFe++TTUl5XK8VtDZDQSOEV4pgDhqtD7UpU3HfB2AikT76AL+fwGheUCJytGvBDUsSlMPKq/FLLk86XHIUieQxaVvdhnuCK5wOx0tCUEYQ5jx4tI6xuRmncPlFc9yBNtp56/oQaGefSLD6ryYXWQEBH68HDNU7yyLPkbZUSwwUyv3xPtaLhNYIzF0XQM/1MDKk8boTBzEDlB55Y52AMD2f/+adMQaU+T69LfauLBBj19HFWSxxRKbjRaTy+7GQV0rTxyqAM0eUDoHzQTsuyqhKkH1ltaoofIciMrqDubad9cIEIdm+NvLnYF/mbwr7yBgKMmJ6pqN5g2bAP6pQ0+qoUOHVOUqSKyDFeEMK1r5+pAa+qNC0UJX1CZfSqug1af7OCE/SsV7+CsSalgE3I/d3/W76OCFTP9ujgyJWsF4tnkLXeaLGPg5/Cw8S6yDsNIE3xVZRqZuGkAZKV5l6JAdDxC6EjfapceM/p4jYEUs+NEm1xPsB7ZnEiG7Xs+htjx8wUzDZ6FV6zU4MJZJGycH90GHGpg+KQ6Ir3p7c0QKVA9qnWUqr9PTk/n5OUt06VTMEZt9zVTbHC6q7gd/TJphaN/s3tBevXvHv5DfHULJdD1bWWOkz4OWgp0yiP3TQ3BFNEO+fTUy45KYXg7v/pMHKohXvuZgM9WJoBiBthSfisSAKQmZXoWBpCpBRNdRPUtmBETJSpi8tIsaBr7Z9AwnZ/u1SPdYFxuHatrS4NevHOCdedGiMDVKI82hWw+jJf3Qeutrew/Nn8ZJasD+jS3b5CziTksGlB0Nk4Kp2/MoqwqsgkkMfpHw5s7Qa5tioPboxL+rP3RCdlKRY6qPNrmamDqDu9QybPUThV/Vl8naFl3BJrez5hwLweohpqQM4LusoSlL55tb/J+wmnZ+KFhEruRQriEEo0JmRmmw8G35+qdh51zOYF/UAht52KYkukB14wKrOfbHLy//gP92SFvZRiWIy/5jacQ6fc1gH0CLWSSCgRuog6zCCSliSST/bbOPQLm4yEU+QNwgqxalzPqynVNy/a41rBv2rSmw5fPi9C4dkpSm9bzA/E7Y5jDVWML25DGvj/x29LCWS+/xbEkbQ3El3y+rBIaRUmzmD/J99h3q/Ghhy7bosmGTM5ZmYD82oItoJrA/bk7Fkez7rMf35nUSqGyi9yE0DQejGxh74TBzS9av3Jy9YMXrkJqtqXGpaHRVMpLxKmoJREKS78I7tDQZ3Q/AL4ITWXAZt5ibe4ijsj1FxM7P6k+OrAmFI7SvBjEpUP3wNkJNOlBtk5qtBWCd7YXGXkeKz8yXjBJQpzrKIgfcln/sOxTzz/SJ1czAYsn5G9pkdcuY3N6och+9bKk0QT3vEbnzLXmqGOYztJ/6UXmWkTntQ53D9iM4B7Wx1riMVACB2cNokbYLoIEATwcT1+sLJVM8jSH/xLvEqzcdg14NS8buEGy9Erd00zmBGYXT9YkH8X2cg8lGLVKJBNc5AX+RKPN33C2etOEc5qdVCDmgumF3FnwKI1URxaWYc8FHuGI X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea0c7792-ad61-4d1e-0fad-08dcf812d892 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:40.8026 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: emY8ygYevCEbrY01mgBrYsKZI52u3RkQaT5YdYR62TXv9BpLV4mKIdrYLy0tOfM3MpmdCydftmZBkaWaU5h0Vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR02MB7877 X-Headers-End: 1t5l4k-0007RS-6G Subject: [f2fs-dev] [RFC PATCH 11/24] tests: add fsck testcase of fixing cp crc X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_cp_bad_crc/README | 5 ++++ tests/f_cp_bad_crc/expect.in | 22 +++++++++++++++++ tests/f_cp_bad_crc/script | 46 ++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 tests/f_cp_bad_crc/README create mode 100644 tests/f_cp_bad_crc/expect.in create mode 100644 tests/f_cp_bad_crc/script diff --git a/tests/f_cp_bad_crc/README b/tests/f_cp_bad_crc/README new file mode 100644 index 000000000000..250ece3f8b5a --- /dev/null +++ b/tests/f_cp_bad_crc/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. create a new file +3. inject crc in current cp with value 0x12345 +4. fsck fixes bad cp by copying backup cp +5. compare cp1 version with cp2 version, both cp should have the same version diff --git a/tests/f_cp_bad_crc/expect.in b/tests/f_cp_bad_crc/expect.in new file mode 100644 index 000000000000..f21fecd2ae17 --- /dev/null +++ b/tests/f_cp_bad_crc/expect.in @@ -0,0 +1,22 @@ +Info: Automatic fix mode enabled. + Invalid CP CRC: offset:_OFFS_, crc:0x12345, calc:_CRC_ +Info: checkpoint state = x : nat_bits crc fsck compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x + +Info: Automatic fix mode enabled. +Info: checkpoint state = x : nat_bits unmount +Info: No error was reported diff --git a/tests/f_cp_bad_crc/script b/tests/f_cp_bad_crc/script new file mode 100644 index 000000000000..5ef689c33ebe --- /dev/null +++ b/tests/f_cp_bad_crc/script @@ -0,0 +1,46 @@ +#!/bin/bash + +DESC="current cp with invalid crc" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +touch $TESTDIR/mntdir/testfile +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +offs=`get_cp checksum_offset` +crc=`get_cp crc` + +echo "crc:$crc offs:$offs" >> $LOG + +$INJECT --cp 0 --mb crc --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -a $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -a $META >> $OUT 2>&1 + +cp1_ver=`$INJECT --cp 1 --mb checkpoint_ver --val 0 --dry-run $META | grep "inject checkpoint_ver of cp" | awk '{print $(NF-2)}'` +cp2_ver=`$INJECT --cp 2 --mb checkpoint_ver --val 0 --dry-run $META | grep "inject checkpoint_ver of cp" | awk '{print $(NF-2)}'` +if [ $(($cp1_ver)) -ne $(($cp2_ver)) ]; then + echo "cp1_ver: $cp1_ver" >> $OUT + echo "cp2_ver: $cp2_ver" >> $OUT +fi +cat $OUT >> $LOG + +CRC=`printf "0x%x" $crc` +sed "s/_CRC_/$CRC/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_OFFS_/$offs/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2867D2AB35 for ; Tue, 29 Oct 2024 12:27:37 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJx-0004a7-EU; Tue, 29 Oct 2024 12:27:37 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJw-0004Zr-9P for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zS4GPqGXndJK4G7VDt8cMpBOpzTeT34OBTLuih9UEUg=; b=DvCh1hFDDy3AFKEw3fkIaGA+LA G7xSHyhQjPy+Dbi4U8l5jjNx1eZ3alyBCUvyljtXr9vsRrQdLf6NbxSA+NqBelJwpC0WybY4pQDze y9dP/Ro89hCWAn8qP9XquUxyy750MTBHNj0naY8+zpJ6RGuvrSTXc+W09dozaNhDfwmo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zS4GPqGXndJK4G7VDt8cMpBOpzTeT34OBTLuih9UEUg=; b=LtesXPUuGhrDeBORh4f+1K89hC iC4nxd/+6FfAg5HH5NiYohnqNLmEYCEpVah9v/Yilwep5/vzcFl6qq4PIoxYszw8qGCWMtp9TcOxo oRtfGrNUr36ct4qGQLtU23AcUOrGKaa/mrIxQK7N0OD3YGHmSsV/+Uhwpb66ekVqD/a4=; Received: from mail-koreacentralazon11013071.outbound.protection.outlook.com ([40.107.44.71] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJv-0000f1-5N for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gthq5It8xjBTlxUd/3f4N8IchBCVhvRECy4jcmZbdHBWIC+g6Jf43gM9Y+rjF27KOE1H36VGc/Vmk3wRgWYTYm5ZRbp3vG0EHCd4AMS4viggY181lUUHdqwemHT68TiS6ydbI62GNqmjGcPXQ/qvZzSC4kaFfCiFd6zC/meiF+J7wPBywA+eV3UgjgSHEJIVZuzBMsfMon2RqTis4bz6QxpjiauiKKNRp8SLcpLc4e7ieyd25hbAT+XohmHkKrKtXww/px5aNEhLOrU0lHkZvfFUPy0TAtWKqsoVoTeFGuIOcpFUumPysYNP7bC6JVKoVl2fBIOfR7sqL+pyLzI2IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zS4GPqGXndJK4G7VDt8cMpBOpzTeT34OBTLuih9UEUg=; b=KrRYaKpTf09fbI90XiJ26TZ7abKA7s27YtYIXRWrezCqNAwNyzAbgrkhcqLVp02HCtP0IlcMaGrOZAKpmWqOAc3GZVWOAOMdtnc6djR/QXju/+tlKQmqVj5XsHe74GJP8kN03FWLMNudxIbbIteIRUFcCa7oVXiovcU7WV3USTKqtG8w6yo9YgPSMneu4yJFvvb90rBP9eR28qBPRmkXWP7Kr8AhLcTamdhoiqHOUe0ew6t5XXbAFMeNTyiglNLZG+Aoe2GxiwhYzy5pMhqqjz1dXlTrdSN0hO1hvtjqz9OGLHyANIMSLS8a9WoXj7MGGLAWKQZqJm/i7fT9xDcQyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zS4GPqGXndJK4G7VDt8cMpBOpzTeT34OBTLuih9UEUg=; b=cV6hR840qDyxriLo61IbUO0byckEND5+xqtTfqss68ILHycg8rn7jkEMpjQ3cSRnysnk0q683n9xOC0ZEtsS2rCAZ3NY2FwKq5Z713xkXiSxWpm9S20hloOdmBKDnsh8OI5iZyRSekaKrOOcd6MqhgJcaS2ETzjj9SsnwDN8C7Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:42 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:42 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:44 +0800 Message-Id: <20241029120956.4186731-13-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 652cd89b-2dd5-46b7-3aa5-08dcf812d947 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: paeo2ZvKARNV0+F415M8Bq7GrPdd4yGvhwpA4IY+qvrVb5TTS5JN+o/9T2ARIAy3TzkTMB3E3R339Qm00bsluqzap6z9P59w8h4VDwOyKodyAcq5EO1KlTrHpG4YTpMv/yL3ty1KLUzNJXOVTCtOtW5QcB3Ka2ZdCqbww4USV/kvJiAnbKREaA97nsuCS0yh67ZPSXX13dgAetZq6MfOz/IyFGMsnLk6SW9K4xdzXrz7FM5kcpxVkmy5t+PtV4nLIHATek7sT2QyhZfQdawSazKJ6W62i1kU5HoKygKMpCgxlPc/1FzXNBZL7FYuwxDrqEvL0eoNsoN9rPDW6zfXj/ZG3Ir8HjliLgNUUwDgVYbwe6mq4F+lrlfmN2NYYjnyyFCxlVl13R4mpA6DShkghDhbl0oZpfGw79uqfZCyrm8N1fQRMO1VeRsSmcMMFwfOaTKor0D69p9yNPRffHkYrjziCh8KqOvkzKkrP4gPyzJYDa5MlKY6z66CwvjLKAsWdkXgrtrKxj8bEOCSHQ9BIbSbrDn0T9abCLBrnsHZNUa4NtSh84640dqWIwO8tUl402fYxb0NKNIebdfGEZPf0hV/0JpPVCrU3YCMvW9atFC0GaDMKrK68wLQCjjdcmrSn/1IU8fwtcr3PXE6CO1yBNL9wb0S8Wl3CFfWQiaIxH1Mwycbcd8UG4boXpMbow+zRMPy+41+4lf6Zt8R36mY32+tPt+/IT7F5VozNEbTdgdDV4qgtOrctr48Sv9E0ljsE5hAyE9nixYOLMQApjFrDTv/FIdREuToF0TG3A2UobW+Y8q7poN58nLdxM/DDOHVfjdeYEO61wpOetEICO/upTRHh+776Jv9d5DifBAzgIOLCkmjeHaARrOayLwTulgloMIav9Y86OjJ7a2RxUwky8emQUQT/awtpvjrignRW4AbitOUMLsr4EbaofwrvRwHG1LHGgG9q9bOkp7zy0Ku8VHY8VEqDq06z0u+604Baa59pUZh7JNocvAe6D+qsDIiSc5e99Bhlg0RzwwWX9aoHvkHKlCRulgKgRphY9DQQ7OcQsWSkvdg8LeelCLzYJvdbRcl4tYQcYYR1+0wSzotffM/mtRVS6Zk5bBDq/MfHDRu58h/7s8e8x7Cvkd6I9xtL/cSpmRhi4tUvZq0KkYRhZhnYYIW+ED9jcMovnTc2tULUxGXX3SJK8iAq5NOhTRRLfoo7Ah6REfOFBLIpmpWun9xrvTs8g6Cln4wBWYsJT0P/1JGUSZZZ6EShBBCk7x+e9g4mrx/fE9MVa9/UrKmGEYOGqdmCuhMIHMNWHaIRCn67cHfc6ar0HP8G4w8UHqgrNMCm87Pqeh+HX9MHD9V3ps96Mt2LtBnVQeu2QJ8TM4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Fho289C6xRykhnqz5bKt57niIfQ9G3210ISo4Hq9Fh7mBmTAVh78DYV3K3vR9j7zntUhrA4SWy5U7+fBAJNEOMQ2z+9ES4Zt7Up5vs2IceuUQCe+des6rjyQwhVZDtW6Fgpf2CD7/Am4c4eliHTzKuADLW8JoFkECCn/AViBNNTUEXxclk6iIi2KV8Pf4M4uLMfFJhsdxaisG6quLIwdan2Tv1qFviQanNOLe8YBwsujlLKU4ad8At9i4LcP7A/yVnF2/qctsIOjDadDcpmz1IYyCXOl3Rh1c1B9Vg0RcID9399GP2+mHqv6lMg7CU0waASG+Re5tVzuAupfn9sttV9YOhHfaJOFXiZA+hQtuYOiE4MVtqLpBamBZOmycO2ikgTn9rwk7bNLH+rXXCcgIBEt/3inyVQJh48/0MjE7ZwmCaJ1V78Xu2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eloMfCxhRRD7FAZZcwtVDxZHP0YJrCGoM0PjhA8G8oOutBuSDouU5uHRjq0yEEOpowdIle8Cswmv6v8nQpbL4MLBY X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 652cd89b-2dd5-46b7-3aa5-08dcf812d947 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:42.0007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oS/5+BTeyHUdqGM9sfhxhBtlTjB+paboxKJC9/FUfUh9psVY0eHX7NvqyHRwRE/e5MxddbFgPqo8LqjGai2uTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJv-0000f1-5N Subject: [f2fs-dev] [RFC PATCH 12/24] tests: add fsck testcase of fixing nat entry with invalid ino X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_nat_bad_ino/README | 4 ++++ tests/f_nat_bad_ino/expect.in | 39 +++++++++++++++++++++++++++++++++++ tests/f_nat_bad_ino/script | 39 +++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 tests/f_nat_bad_ino/README create mode 100644 tests/f_nat_bad_ino/expect.in create mode 100644 tests/f_nat_bad_ino/script diff --git a/tests/f_nat_bad_ino/README b/tests/f_nat_bad_ino/README new file mode 100644 index 000000000000..b97015297b25 --- /dev/null +++ b/tests/f_nat_bad_ino/README @@ -0,0 +1,4 @@ +1. create f2fs image +2. mount f2fs and create a regular file +3. inject ino in nat entry with value 0x12345 of the regular file +4. fsck fixes the nat entry by nullifying it diff --git a/tests/f_nat_bad_ino/expect.in b/tests/f_nat_bad_ino/expect.in new file mode 100644 index 000000000000..99ad7705fd47 --- /dev/null +++ b/tests/f_nat_bad_ino/expect.in @@ -0,0 +1,39 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (sanity_check_nid: x) --> nid[_INO_] nat_entry->ino[0x12345] footer.ino[_INO_] +[FIX] (__chk_dentries:x) --> Unlink [_INO_] - testfile len[0x8], type[0x1] + +NID[_INO_] is unreachable, blkaddr:_BLK_ +[FSCK] Unreachable nat entries [Fail] [x] +[FSCK] SIT valid block bitmap checking [Fail] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Fail] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Fail] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Fail] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +[FIX] (nullify_nat_entry:x) --> Remove nid [_INO_] in NAT +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_nat_bad_ino/script b/tests/f_nat_bad_ino/script new file mode 100644 index 000000000000..18db1db97b03 --- /dev/null +++ b/tests/f_nat_bad_ino/script @@ -0,0 +1,39 @@ +#!/bin/sh + +DESC="nat entry with invalid ino" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +touch $TESTDIR/mntdir/testfile +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +blk=`$DUMP $DUMP_OPTS -i $ino -d 1 $META | grep nat_entry.block_addr | sed 's/.*nat_entry\.block_addr\s*\[\(0x[0-9a-f]\+\)\]/\1/g'` + +echo "ino:$ino blk:$blk" >> $LOG + +$INJECT --nat 1 --nid $ino --mb ino --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +INO=`printf "0x%x" $ino` +sed "s/_INO_/$INO/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_BLK_/$blk/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F8DDD2AB2F for ; Tue, 29 Oct 2024 12:12:07 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4x-00043H-8G; Tue, 29 Oct 2024 12:12:07 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4w-000432-7r for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xrs6IJHiG5as3W0LqMnh5DA9cS3174M6LIJV6YECcns=; b=BbenupamskQn2ddX2ulXOCNhco JZrkp1uX6AEF22ooJ1H23sdJ27vwDwFJMP772LQNrw55/xefBJUwMTxi1U0I6mUk8otHsnzwKk6Yn zhS83F5ljToaYcH11kFAcBPMUiMwEarly7Cb63j4WJ4jyeZaMY3J6xMsXWm33zDKAbM8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xrs6IJHiG5as3W0LqMnh5DA9cS3174M6LIJV6YECcns=; b=dqQo9Dg/rnZUEc/mqNh//B7CVr beJLnUjMqATCvGtQFYnww8Vb+3zEgDvjTayN7IgnPyRH4y2TTYpO4Qspz0mr4xlJUm33oV1sP3Bui w8iJ+CmK3ThtVwjo1vJNxFWqVTjo+DZXnFLpmctxG66q7Fz6sw9kzof9z9IxS1WdHAeY=; Received: from mail-koreacentralazon11013051.outbound.protection.outlook.com ([40.107.44.51] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4u-0007Sn-US for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R+488/6ncfgqBh2MFFjgC5Do/2emz7Jf3TimJphB7Ll/9lNzGdQDRD3rhfKa2BSTExhjItSzykQY6dxqrRk9D6J/DdFOD3eZMPGtl00IyhlMBrf2o/39aBqgNMY98BWkU/l2ab3uiCmzI6uVdRUKfY5usfOCBqg21HTdQBwGaEiVEL2ElawbIvvZhwQ+YCQACZ2YrynkSzhT7e6+kaYC6cr070uFGifVtU5uZvGHQsVk8TVlVkRlA7iZWQapO0CP7+WOABeDXXN1f9MVKu1FdJzJQlXigNMrCqaOKpLhh6iMpKo4CXGUruItuOjeuAFHj2eQbNfgw8NWr/j+ZZQruA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xrs6IJHiG5as3W0LqMnh5DA9cS3174M6LIJV6YECcns=; b=sQHuFD1y9n5/9L8WxEriug263t7zbbfpylDwLxIRxgEVA5SeYaEaXEWLzgc/UqyiET6kCilBOihGLWdL1LkvkcafrcJlWZpFd/wMngFcrPe6EY7Q1K66YU5z587gGHVqQC6Tn8eLOdlMLAa2gtC3y8WTeTWu25pyW5j9vrLfMNPRPH72fRWJUWRug8xGptFaQdQsbib0tKfnpv44VD/1yod+LfxZf+bB0A3iLetJMb5rXF95NQIS8gid1IUMKrrN/jQyDDfrHtz5Q9s/weZPdBYIBlMlTmJkRko87Mh3v62d5Gwf2ECX8yILzm7xdXzuWDabfyz3Tcgfnu3f2SfOeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xrs6IJHiG5as3W0LqMnh5DA9cS3174M6LIJV6YECcns=; b=oOFVBfpBUT6uvitFEHOEqIP1vmZzGg+ncMCItdLgptjbIfiN3ElH/uIQwiHh2rLplAXlRvGWRR46JJLu5BvvZ83GhggxdedzQeEg7WhJZKobIgYIk3b9hF4hj3wlMkciz6vjVhkqIpa4B/5oZ3d2EkF9qDDFdSEFsSYNPlnv7y8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:43 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:43 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:45 +0800 Message-Id: <20241029120956.4186731-14-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a3487d0-dd57-4015-fc99-08dcf812d9ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: RUbbTfLpNsi5sThzojIw3w+ze9I3zj1GT6LDea9lw7MdQ7Q0N5N0bPcMa3ChUd6pvEpymVu18BG4gocBrzJvt+jGv/wOaUN5Ay+QcWVgqFd632pMTaMNUonl6v5vglhl2GJ3DUEv27Jup/pAGzAMdbsT7pujUTThmVkTvB/I12LQDcYAmJJxYqol5N6etWt/ciMBYL2lz4xHjnnyk06ClKR+EHPUUJh/dA+Te5Ergx7QAHNcN5+39cgrfjktjIWbjAezte1nv3Yw7722/JqEbyJ60ICHB3XOgl4U4nVamp4cHk6SjrdrPL3lm6/LKFzbeUWPMbGlDG/fsr5ANYy3fU+G7wLvwGjbm3BJVONBOKrdMEpkCvXucjCzXycN9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apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qhs8gZyZhXQemy0UgXW4WMo+lxobKSpch98v4qUtenrVqslQPL3dHXyHDCJxYnarP/E6CZ5P+xUdKKc5Za1ZqTu6GEpktlU4cd787AwNduuLfOZHfymg29MYb6VxPYo8fiipiqhh+OK8HnTzoRjlSoVQJPWxW5rmmrXT73laSK53kKg2cw4v9Vk9gWdmitJK+XbXJtic+yxp6Jc6AFJDagJtOYGMjXIfZmdtMnXEjeASu6uJaxiL4mu0OHrD1skPCjl4FybM9UVyIdop22fy9/fvOnwvo3WNh6r4YkxKN90U2Kmmv+Q6aZ8GLV85gt1Xw/36B6s0ImlPJzLwfdiJfI6EqHi6v5b2zaSv85JZCEOKDdP4djCqAN07LEGVnB1plAG0JAr228thV54xjyiMIjVLKVl7zNXuYxHIE2qICxCKuippnc3SS03irYLtvyYtmlcz29Gm72vgWu8G88nx7nNP9WjClY8C68Cy00ciM8gZzBZ+B4u6B+WMuFaGnwYUlk2PSTIYm3J6hbgW+9l80H/gXCQBdfC+e6z/tHGg6UcZ02kSLUygglXvJ8TMPIeGMiwnVkt1cvjX8MdlTisfybrA7uvTIDKzQUBFJeMahm0RzrwETnVcs/WoNh60Knw3hPHjXFNEHWAx4xlkdpyjjk/D6+lInbA8zG4GNzLfYrnttLRvtE73OJDCrGbPJgxdacLVhPjvCIk7sDq6ziCaXW++KoK41lZXJ8g5wKi9wTqvIjAI+LyfWfuC1eRP36aaiY2/L496IF7uVLDEwak9pvtyEII6q9j+fqT//f0IbHfq6Dp+HLuvOq2SRoc2mfAEYejBo0x0ffvTyUio6XyhS4aJmiMfPdgtMmPMAnUvEI0VJPJt0yFzR7cAlRd2twxyFOyMbYngqheOg1orpfpKGPE3TWEOFekQuBmGuVAMZfo9qVIB0mFKzubxMruPu35PSBXvuhZw/Qy/w5iS1+Ko0KxYatssZu+SZbLK3q8DyF+icbCFFXE6LKK3y5G6eGGsOuf1niQ1U93JC2ryeFSbiiH0t743R0D+8ru2yQyH6VJBnb0OWJRwrf00k9TL7q6rEewQHjGlxmfNBU687vl1dq5nNyh0pLSdPOsM9vdllJBGqORj/tKxLTmR9xTU3Jxp/uVcXcPqHI6Z/H4DwWQFSEzutkNo0l9fppI0JMPQ0qTv63DBWYisv8sX8tPP3NdMzEb9YSWKWxmVVD28VuyDJuL8E1BxIWJ2hVTzfhkAvuf4VMcn7LD52+0fUZldVU9j4JjCO+D1OAiRriJW9q/fUOw4Z878BcZPXEAC2d3VXEXpB4U0AoBw2yxQowQBywt018RG4LDKU/iaIF7pD56/GlFFpGQF6ESlVKjZ9DANl8r7L+bAvDXTDPuL0GTsEYkymbMKUVq9Sp99YssX4UlPOvfJBzY9OkhMSCilEzwsNSNsIWyLDqblnjsbqYX/wW4bH54OkQhComzVnu6G7gJGeSML929zJ9h+Ay7cNaA1Ex+b0XpVrtLPX9OBkLXNqlvXuScvtlZLGrQIsi/3DqUvYuIrB9upJNij8wLJWtk5SlhjIAURHbcsYEj+SqRKvhy/ X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a3487d0-dd57-4015-fc99-08dcf812d9ff X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:43.2135 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2D4BCXKeVg5sF/29qAHGmYL44BBJyRMD/VPmoz6tLP8a5L2siCEoUGS2B1FhDoVg6T3V4W5ljS1KUMAOvFjFEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5l4u-0007Sn-US Subject: [f2fs-dev] [RFC PATCH 13/24] tests: add fsck testcase of fixing nat entry with invalid blkaddr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_nat_bad_blkaddr/README | 4 ++++ tests/f_nat_bad_blkaddr/expect.in | 39 +++++++++++++++++++++++++++++++ tests/f_nat_bad_blkaddr/script | 35 +++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 tests/f_nat_bad_blkaddr/README create mode 100644 tests/f_nat_bad_blkaddr/expect.in create mode 100644 tests/f_nat_bad_blkaddr/script diff --git a/tests/f_nat_bad_blkaddr/README b/tests/f_nat_bad_blkaddr/README new file mode 100644 index 000000000000..1545fb0fb342 --- /dev/null +++ b/tests/f_nat_bad_blkaddr/README @@ -0,0 +1,4 @@ +1. create f2fs image +2. mount f2fs and create a regular file +3. inject block_addr in nat entry with value 0x12345 of the regular file +4. fsck fixes the nat entry by nullifying it diff --git a/tests/f_nat_bad_blkaddr/expect.in b/tests/f_nat_bad_blkaddr/expect.in new file mode 100644 index 000000000000..32a3aa4bc77d --- /dev/null +++ b/tests/f_nat_bad_blkaddr/expect.in @@ -0,0 +1,39 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (sanity_check_nat: x) --> blkaddress is not valid. [_BLK_] +[FIX] (__chk_dentries:x) --> Unlink [_INO_] - testfile len[0x8], type[0x1] + +NID[_INO_] is unreachable, blkaddr:_BLK_ +[FSCK] Unreachable nat entries [Fail] [x] +[FSCK] SIT valid block bitmap checking [Fail] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Fail] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Fail] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Fail] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +[FIX] (nullify_nat_entry:x) --> Remove nid [_INO_] in NAT +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_nat_bad_blkaddr/script b/tests/f_nat_bad_blkaddr/script new file mode 100644 index 000000000000..7adb48bf9f0a --- /dev/null +++ b/tests/f_nat_bad_blkaddr/script @@ -0,0 +1,35 @@ +#!/bin/bash + +DESC="nat entry with invalid block_addr" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +touch $TESTDIR/mntdir/testfile +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$INJECT --nat 0 --nid $ino --mb block_addr --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +INO=`printf "0x%x" $ino` +sed "s/_INO_/$INO/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_BLK_/0x12345/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5D40D2AB35 for ; Tue, 29 Oct 2024 12:26:58 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJJ-0006il-GL; Tue, 29 Oct 2024 12:26:58 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJH-0006ib-0K for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bIj2uAcDhxv0OjC9c9O2Q9P0Ec1jmp/LYUTdXryx4lo=; b=iLW0AMTX6+v3g/KaezlocUP2iL AnEJslaJ1SQiMCGW9IUcVvSqoXTi3UJxsZlhq93I5w1PCDwBcXr5Xm0DzTTU9mriGzvCkB7312duU Th0krXwbKFxs9vkZYVXbb254t9J7brI5CKlvFjLAU4LXcgkLygI4a0NKzcSxCwWRkL5U=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bIj2uAcDhxv0OjC9c9O2Q9P0Ec1jmp/LYUTdXryx4lo=; b=ksn7sHYjbk5ySHkxcZPXRgHIgk QnD1J496Tftn0OGHSOWG/XaWYn0hp9D8+gCHHy1G5u6eRgs8iixuUcGXsCM4np+RM8rAjEjf7yifX uuHU8k6FyZ7q/Ayv2Nm6P6NwXuDsM5qM3wdRKsKtFo1UEcHSLBWogeTmVf/RMVsGPR6Y=; Received: from mail-eastasiaazon11010057.outbound.protection.outlook.com ([52.101.128.57] helo=HK2PR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJG-0000bs-Mc for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kcIArFqiLUId7UP4IlRWFlXX0tF7pUcK9i8C50hIssZc7ZK8N1stXF4MBN940luyyPiYuH9TILwe2gHXMBebzOKuWXprnquo3gkazzmdxd3GEJqoz2VWj54P3bwpzgr/OSDTEVZJ+6LjXnga3z4ZK4Yb0KjnedaGlXYzq6DPiaBG11TKdGmQ+4N99ZYaX7uobwChkXcHHzmW4vJ8OY65JTVdtVczrBQRgjxNKjTfNq8Sp9lNZdfAREyjhSSrSiYZkNC3ChITNNH1IdEic7p/1pzOT4v6Hfh3g2qyeJjATUvb8HXiVvWl5XOPjC7zCNRP9W9I2xgBvhB3De53j2KTyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bIj2uAcDhxv0OjC9c9O2Q9P0Ec1jmp/LYUTdXryx4lo=; b=U6SB+0VQk529kI3ADZNWY93ukhmlx0B8SKFADGpGstEP3Q6kaKp0ms8rzRDBKdBv5n/KcY/4aP9Oq/fdgOh7bqnrAfa+qC/spy1Cuao6VrtXF2dereqyEC2fNBH5xi/rvqf0YMoBLPsyzoSGMqJkQc1Zmojpl3Ggvh8HtY7eqEDmpOyGrbF5RjnU+9gBCnRk0pcJxBAUikUkrBw2JyTeouwoIqxRCixlbiwpc7OkrVQbQxAXgd/rkAZGp0yp5MTe3/efOSc0aELpvJGfaDAMBVo80Fk53pBoyGPl/u+QnyRMwq4r8CYxk7d3rFwaQYWde+h0gECMMBtxGkR+iJBdmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bIj2uAcDhxv0OjC9c9O2Q9P0Ec1jmp/LYUTdXryx4lo=; b=Qp956mk0SVaQhaBJNLUWPHpkWb8zML2NxCHI173tbHkfHfW2Mqbb3nnf8PH7bgNUGV0z3baP+m/gheskENuQ03Y7jEUu5HWSPO14b8EIS3bmzTlnSH/QzN1VlnQ/eN2JrH+uYzw2ELJIMqprQsY48FXnJQQ6eRV/ANlhh0wzVt0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:44 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:44 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:46 +0800 Message-Id: <20241029120956.4186731-15-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 2344d5b1-1600-41c3-e819-08dcf812dab8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: fwGUIiRja7TRdunYK61vkPgndxwAQl1WExapcDyKt/Iw3mSEYUGQCNt4T5HVPxE7ZOQYCqTGJPkM96zHWKPHxsJOoFNUNLgVDZqOP3fNZLJ5hB8oWigMYPqNRuz1N3hCNpBM+C3h5K/cycAvTGlgWZfLHCshfiqRbkyA2U+zFjMUl9DC8/iaaVvIgm/zs+lCY94qPVkqNAPuQm1vunJQTRB5nT1JKU7fhOLjMZL9uax/daSB6Fr+bz4ETmqi55+z12VIh10pRZLC/w6mfXhmsd5L3qG6+jH+aGq46gWI7PTUoq5pVscwFEsKVrnTtb8ZZkTqPQVRyJi276ox81Rew7dUuATSGaVEVpWMGHZd7AXfct3CbgD4r4Nhvz/F2LmWVQarywO1VxTT9553Rf6kaVHeeQxjZUQoMKjgZ43hpqbtOJIyEEXij9jRevVkcI5o61JMagB81NCfIaYvFeT689OlQBdLi8EjFCvjMAZaAlne4lwlrD+uJ3RPIDqKSgicSXaVZVXzPJ1T+yXNx9yKv5w8HGhkyr920n2pbwiG9KWzrtaVjj8LMJd4J1VQhMu29fIP3Po3p63FvsTyQAuXxQrmRYK5CMoPAo5lHZC/xDJndE/FyHUNOkRoNFtuKDHWpyBGecz+gVQL3GC+AB6HrizDBm6qz6Q4fb3xyYOT7gyuuNmoZ7SLkQ6uG73FGUtA5Ff4rVTrBj6Muwp73r7GC6iKDhhl0qsbSMNk7Ap5z4+b9jBaP5psvxWKclH7An8yGJNqxz51uF9datb4VcN5tbfSLE2X8HTSgxN8+tHUZq7PC2iYCoap2hZnKubNHIxfMw5kcUT7g4Vwzf4dC+zcxDCzmfvBYt8oXHAPaMRA6ufohy4oBgIEWTLhVD9PRGHSiUwmUJxGwrHy5eQgNv7+aVi0PNeliYHhFV7y3gRRka1S+3qnc2yjBzNv0WamSkdlJmk0KMXriaN2YxiGvg4YklHerRgzSrxCx7XSdqgTz/iIU34tq/2Mxmga/mpJYuLrXnvxA9SCXpFnv43LWGTu2WMt4kfHnsZ9QxjacFZwoqJ57kh9cUt5vikRbObjgzODsC8YQDoIXJGVrNP+WyS7VEcjp+vJHPlb+vycbWmNs0R/n2FB/r+SP2pHqlTJZdZsJWuiuH/N6OFh5yfR6mmQlGeHV0RH9emeBNlo3CtbH6vIE8cjzrFhH7d3fhTV3Cw/vCaf/QtcXc9IlxavCpiIhTcNhojHAogFGsM8UQaBOpte9oM8/cC+JawyeflJ8irjHVo8kAbW46DjN2JIW+7WLQQg5CsThohWHnMiXCVhuAhQQWqu3k2yiPYnpB/kD+O0dx8FYu8AZxYZa0JoralilIyKSKJ66GDFHGi+bQlCgko= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: isG2M9fuEIQsw1dXFSlWMw3kCVc0HTJMP72kIafvLkiufY+Y9221HMtVQ9hZrmeJNx04MnfjcoHDNPO+UO8EsqbgyTs/p2FRcroP2Kpaq3D+sTSJ808o1nhUl8RJ3mwCMuHdizG8LCYtIG39nXzJZd2+0IX6qyw8vjiNo/cLHrOgjvaHhfqa48CtDC8Ni45plXaM+wyI+Dz/c+kRwML2VZ7I5OAqcmb3ojzph213O7hrTOuTenRHjP5IPuxCTiRctjViuv/c22Ty/jgMJNEXIq/RlR/fJAI6zUwMzsq40bxkHqW+PQspEwpMuqg79ZUMnbXkUKT2WE6PJHRn7VS/trGM3lp3t3SzlyJp9IvUgRiIqF/148h7Z0r7AqWYMVI2g0vO20J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CU8DXKAB+Q5gwS4Mg/KWTckna09tEsE1ihkLXcB+f/gkCeaBIstHf66btEdX0uw7dS5c1EonxWvNrMyXUWNnzNbX9ub2tGjeU0QAlAgq6mVkyxlusoFvJ1mfO752 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2344d5b1-1600-41c3-e819-08dcf812dab8 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:44.4201 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OtAm2dhwRMGaNPYRmqyIR9+WkulLfu44yrYAA/M0f3JNkEinXvs8hcmuv9ddRzzzlaDiCALftqOy3PqWdqh9kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJG-0000bs-Mc Subject: [f2fs-dev] [RFC PATCH 14/24] tests: add fsck testcase of fixing sit entry type X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_sit_bad_type/README | 5 ++++ tests/f_sit_bad_type/expect.in | 34 +++++++++++++++++++++++++ tests/f_sit_bad_type/script | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 tests/f_sit_bad_type/README create mode 100644 tests/f_sit_bad_type/expect.in create mode 100644 tests/f_sit_bad_type/script diff --git a/tests/f_sit_bad_type/README b/tests/f_sit_bad_type/README new file mode 100644 index 000000000000..e0a1726528c0 --- /dev/null +++ b/tests/f_sit_bad_type/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject type in the sit entry of the blkaddr and change its type to NODE +5. fsck fixes the type to DATA diff --git a/tests/f_sit_bad_type/expect.in b/tests/f_sit_bad_type/expect.in new file mode 100644 index 000000000000..3e69b378336a --- /dev/null +++ b/tests/f_sit_bad_type/expect.in @@ -0,0 +1,34 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FIX] (check_sit_types:x) --> Wrong segment type [_SEGNO_] 3 -> 1 +[FSCK] other corrupted bugs [Ok..] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_sit_bad_type/script b/tests/f_sit_bad_type/script new file mode 100644 index 000000000000..cb475ba8232d --- /dev/null +++ b/tests/f_sit_bad_type/script @@ -0,0 +1,45 @@ +#!/bin/sh + +DESC="sit entry with invalid type" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +SIT_VBLOCKS_SHIFT=10 +SIT_VBLOCKS_MASK=$(((1 << $SIT_VBLOCKS_SHIFT) - 1)) +val=`$INJECT --dry-run --sit 1 --blk $blkaddr --mb vblocks $META | grep "inject sit entry vblocks" | awk '{print $(NF-2)}'` +vblocks=$(($val & $SIT_VBLOCKS_MASK)) +val=$(($vblocks | (0x3 << $SIT_VBLOCKS_SHIFT))) + +$INJECT --sit 1 --blk $blkaddr --mb vblocks --val $val $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +sed "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect.in > $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C9D3D2AB37 for ; Tue, 29 Oct 2024 12:27:22 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJi-0004Ye-2g; Tue, 29 Oct 2024 12:27:22 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJg-0004YS-9D for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QDrVWM65ulXAwBxar46vr6bYD3hp2d0htbqKM2Ajfio=; b=QAYwfYgyJv2+EuMCTFAgdlwgma NS2S1JWhTDS3BQg3ynbD20Q5PGDyVY0LQT7CN627W56gsuyaSb6rkynwGHGt4FgdQjPhEHXrO0PHJ OAVhucUZ1uTWq7a4f2hEAvNKNTHQ+wZDtMx5LGNhX8I+IHviQ96G/orWwy/o+erg+ISc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QDrVWM65ulXAwBxar46vr6bYD3hp2d0htbqKM2Ajfio=; b=N3jDbMD+rDlIAbpv9J3UvHza/l 2V0cRIh5ORPsAZa/CLA/r9R2ggaNagtczgl8qPaU9n5msWt1pHVRdZNXe/hJkeYf3nsmHzqvW8QnV xwzNntCH/5ht0nLawdSZx2D0pYZJ2zsswooU3bItpHL7STFdElZRj4xC0bhR3FwsqgIU=; Received: from mail-koreacentralazon11013046.outbound.protection.outlook.com ([40.107.44.46] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJf-0000dg-HM for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rvoDSjbHRVP3QPVvbxfXsfe2R2OWYScSU8QSo9OgBxbV0CVGQpxDBWlNWOB5tsm2E4QWdx4bA0sPf/9cizNyw4eZQKNLI0Q+z5Ip8KuN8kFYY6ppOik4cJznAdKFpkisRJhe97Rj7vKTdsHDLicV5JOIoJPxLPm5yDJZO9w65km83xWdmtdicX240u/Y6HtS2Z9wgZDVdpomDx/4BAJxARi9AdZeOjGwzprAxKSIm1Q3DD2VC1B4SWCFM+Fb2Un1fTP2K8+q/I4mUcbkxRKwikwKr1sfOTQ1/fGuzL7Vzv7nuUc3axF7wcrJZ4tXobhIs5b0/oXePmrz2TpHx0Iiog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QDrVWM65ulXAwBxar46vr6bYD3hp2d0htbqKM2Ajfio=; b=Ls9lZqatTVwre7IkkQEDkRWmy5e1fwVEpRXuyc3aauAqSkWUuU7Iz1ARqIOnVUYf2lQjvjPsfDOYb1qu8tJHvaDRkLwLfsjGo5pq0xaX9FKuhO4ktQcWw5D9Pd8ApXUvmMtHDxssHalzu3FpRxNoFH7hKylADC6PAR8oYgYs2ITsE0tR4X2n+HiAW/QRkjNweJiKPqGEzU3D6D01ECtQug53RgaIgKDJwzRhk+n/QxrlWUltcHhJJwciPcHXV3epnZUSvHSDoXzt4jHj7x7m6b0cxDYo17vAdjrxp/Bg0S2AWxraseWFhpWDhb/zF5gpi3euLf03ETerrwerdXuDzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QDrVWM65ulXAwBxar46vr6bYD3hp2d0htbqKM2Ajfio=; b=gbP+PN+6vzEKp8CjRm01cezXhF7ZosCSSdqhgi0i0AmRhu9P5edkiMxBp2omapYQvrEC68kqk1oB/tep0qHaaryeqaqXkulnPqF4d5ECIkoqffAl5y9lrVhp+EQKKwF6dZa8abcXcH2ZfTFaLOmv7vt9pAWULSmXWsqBaLBv4gY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:45 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:45 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:47 +0800 Message-Id: <20241029120956.4186731-16-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: ae81b346-51a7-472d-04be-08dcf812db70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 0IAoBEXSft3l8zH/ENU9lj8hRiowYCUXBNrtgVkFIqGUDxn3yJNCMXmld/64Drg+f8BAqeMp+nCpzumw0H4wNiJ9fVnEeNx9eqnOP+JXIP75ghxdlvjFzJO/CL3fbgo2+ONhqQqLHvYv3D0QCxJUDLbfLrVt+04G9PwkocO+k2Wf9nOUmLIJizCcdcK0bnxT/ndN3n7h1eawsQJ7SMSCt65bp9Q7z2nqNDr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NCNuPwC4uIMfYD7Kt+6aNxwm5HFOPxIIt+jHWX8ZauJ+kd0LtNTDWk4NK2zfbOb97LpFgPGbmEJhTo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8EtDqQ3pCOlUV6ARHNoVe/Nh3l2n+t7w0syi/qlVKlYdOlUarbgf9JA+Wc2BAwwTOonfv+VYlk7Hw7kiGM88TuBeqvDwmpd6KfNtbtJttfR+tTqjBGhAc1KKhwr4ob8vrgNBASHgl1/71V4tTXW10UNSc++l69kI0zeBqaLy3ErS92Ti6k4+Eaj2R+6crIRmgOOJLdKwaexBwBR8RYL3ZB6/9D4qohYxu//27XbLMnUGl0p+jT01kbIbC6JcFb5AhTrpY+3DJ0cBMgofskJJtsGGYe+lc0JqBUzx+vb1v1vvuC4gciwCvxO6d6Ee7b5Mk++H46URAm8DasvLlCFYgsICmml1hsGzCWnmpiIvdHiuASIObBH21PZUFe3A+VNwDO+Q/N4KHIr6v2GMXk9ZnOQ7+rLa8M4qvJTP4JpRRHRHgXWTBS2SiEBO/tBCCUysBK7jfakKqEqOQ9y43gFmSTpth79VTicM2JQxHgH/is/eVUc+b7+yYJK2U3JxsJABlduUMs1qfI1CyO6vOsNccgNGXBKps6h0rQcHc3yKL7Ef6T37ndXtAtJWq2TOfPkIo5/ahqnAQn1GpTlDfhUgOfmnrI5m2eIoE3skkTS0ShFxVfxQPwqoEF5nBE8MCrAWKPD/z/EyJmF5k2yQ0u9HDNTD8z8o7LMNye84cWd7oP4loskFp6gpz4mpSHGzNTwrBDmA6hiWUaM661B4A7FlndRGHvTHCgldKilJjpQJe1nv6NjW+//Gz4iXp/f9tsS3caQzoFTYznQYNLrSfggAf1VqDfWIQEJyzYN6qHpWv0uwnlLr+pDgKVW1Rccq1lwtoggqO9O8thqtxZu7k8W0TOHtTrd2tTXCqICPorN453kTDHMGvCKR/xQ70kwczifUTn6VBbDcDiYzUCEstprJ0/jNykVTkZGgcxtCjoBnarSJ282aLQtKHjZycqNW9AOEt8YOjDyTt+zSFZ8TpSelvt0wEvRffgxtidHLgRVtsoeaQAzBu/KGg+cHsudr5bcEuvkMEIUnlwvvuQaYDuqjjLXIQGKb7IO76MM1n0BRsvgqPzzSI9/EdEqqBhVPe06NXhLB6U1Lc11E8pRQKcIclDGJ/kYt24TSz4J/e7qUuzyV5bAIgmZ1V7UeJguMu8BGQ9P9Ik/1gzUXISRJHaNt+1Y49hc6MCbV52VIy39ypNWHHO1O2Es0eUS/jzNCgnLuxM4FA4LR+KJ/zGZdb6if68S9Bk5tnSp99wOBnOthEcJEcNzOC8h7Lpis3eu0NDSATGxyjpWqeWSdpUh+mQuSs0pfG31eSMX4/1Jy3NW1hI8prtflHNdZKLQ3mOFAFIbXH3gPQYXCDSxQlVut0QykY2DVn6ILgFO1+YMx4Rr4FpVRALD7nACgJti1tctf0UVVI5/7suqFfutAgFFEFugM4aApdtTi+SR67ZIfqqrxY4f1/5xdvbkWWRQ7aycpszzOs6TmQVY1IqtYDnOzths25VPzMZXvc+v1GiFk8nh4Xl0K5e04F513+XeXkQDXHc8WPsXK+reNnUrH35E+WSTSVNzml/J9GLTTpV3R9jqLhuY1jyI20Dw6KVZ2EhYxSFkU X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae81b346-51a7-472d-04be-08dcf812db70 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:45.6083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D8HYrCN/kSeu/weimtyA7srwNfDJgbe69kTTxKwqte6z3x1Dd9NI2+vENvSVTdqhAQl82ubGsuV7S/kYVZ3plg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJf-0000dg-HM Subject: [f2fs-dev] [RFC PATCH 15/24] tests: add fsck testcase of fixing sit entry vblocks X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_sit_bad_vblocks/README | 5 ++++ tests/f_sit_bad_vblocks/expect.in | 34 +++++++++++++++++++++++ tests/f_sit_bad_vblocks/script | 45 +++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 tests/f_sit_bad_vblocks/README create mode 100644 tests/f_sit_bad_vblocks/expect.in create mode 100644 tests/f_sit_bad_vblocks/script diff --git a/tests/f_sit_bad_vblocks/README b/tests/f_sit_bad_vblocks/README new file mode 100644 index 000000000000..f0cad7e7e319 --- /dev/null +++ b/tests/f_sit_bad_vblocks/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject vblocks in the sit entry of the blkaddr by subtracting 1 +5. fsck fixed the vblocks diff --git a/tests/f_sit_bad_vblocks/expect.in b/tests/f_sit_bad_vblocks/expect.in new file mode 100644 index 000000000000..880af341d65a --- /dev/null +++ b/tests/f_sit_bad_vblocks/expect.in @@ -0,0 +1,34 @@ +Info: Force to fix corruption +[ASSERT] (check_block_count:x) --> Wrong SIT valid blocks: segno=_SEGNO_, 511 vs. 512 +Info: checkpoint state = x : nat_bits crc compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_sit_bad_vblocks/script b/tests/f_sit_bad_vblocks/script new file mode 100644 index 000000000000..500d100d2c0d --- /dev/null +++ b/tests/f_sit_bad_vblocks/script @@ -0,0 +1,45 @@ +#!/bin/sh + +DESC="sit entry with invalid vblocks" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +SIT_VBLOCKS_SHIFT=10 +SIT_VBLOCKS_MASK=$(((1 << $SIT_VBLOCKS_SHIFT) - 1)) +val=`$INJECT --dry-run --sit 1 --blk $blkaddr --mb vblocks $META | grep "inject sit entry vblocks" | awk '{print $(NF-2)}'` +vblocks=$(($val & $SIT_VBLOCKS_MASK)) +val=$(($vblocks - 1)) + +$INJECT --sit 1 --blk $blkaddr --mb vblocks --val $val $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +sed "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect.in > $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5507AD2AB33 for ; Tue, 29 Oct 2024 12:28:03 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lKN-0008U7-Jb; Tue, 29 Oct 2024 12:28:03 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lKM-0008U1-Qr for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:28:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=a3759lDW2XG3mIcQ07LLA7vNDxcRHU3ZF6wrqWaZn6c=; b=mquHbgAO1+qztbDseCvBzApQIk ZJKgaZZbsYYyD7jUbEFhWHvCDETbs4iGmY8McpCvWSy4iLmPV7SkkFgByntfWWDGbZCjiiBEEHi6e UjSSe6JbnFUbck1E3daf9S1inUyRXgi0wl9s++PrFHZoe2PuRbBwbpmRL4I51ps5M2NM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=a3759lDW2XG3mIcQ07LLA7vNDxcRHU3ZF6wrqWaZn6c=; b=M8PRXE4sMsiR2XLRT6SyiwHR0o 6gyKFQIxFmT4YloM7ogYg7jOy95ZcB74XN6MBpunYCXAfXE33/c6ouLXEE9dCVWQWniku7q3VuN0a mvNIG0+O9YPBLPQFkUXcah69+F//impG0jfXuXE+ImYCKHZFiYv+l8/e3GTdGyAXUJZo=; Received: from mail-koreacentralazon11013000.outbound.protection.outlook.com ([40.107.44.0] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lKL-0000i3-EP for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:28:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OlBbSbCGSMvuidlDFjLr5zbBxXGjKlqUwfLLeaiNEyG8i2yAhW4nR8cGN22D2Ube06lsca8QsHRh47VoRE0HTMZliTQaNAUhghc8mc5NzY5vGBvxNo5kQPv6RLfBWvgU7ZVfISCXqL14TXmmzG3R6P725Kz1t5TRMzqVopB8XbhjLFEBg1K4hvNVZy84dC+IpRc00m5eGF5PT2x1TQkDSTYLLawLlKFxeIY1g+iz4KhHDTUhTz0ah40MWQfRwj9rhQIrkqD/PMlSy0JzsH2vozcLc6zuli3+FYvQE/949hIBbdaojHFBUX1i4BVaMO4YAc4lwfavQMgye44i6RRGEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a3759lDW2XG3mIcQ07LLA7vNDxcRHU3ZF6wrqWaZn6c=; b=pPntV7GLVGJ681eWEupLLLa5VEbJA/a8MGuhIMSTJ17mqiCCGVJ/OfBFvkzFkRWAI/MYtfsbyc65X7s7eJ10V8OlgrgY/CLkMxG6ZtsfgtH2P7q9G/qWaRFp5hAH8N1yqURKd+dAD+20WkasQOn5mYYuVehpcg46X+2BpPny99k8DTYgAbD147T/IojXKyNMoSxckj8/f3kHpJL2v8qr+BU1+NgXlekIXhFx3jrPA0PvBcE4Cs8zr/5LeXxYdExiibhURqmXMPTa71myaZbxHRe3nOH82YrvtpzF3QGneYsaZkwkCWZrRpGC4zP2d5QcWh5ca2+0rMp2QTTmoAuItA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a3759lDW2XG3mIcQ07LLA7vNDxcRHU3ZF6wrqWaZn6c=; b=Sa+pMGfx3pDe8s0rsLK2Uf1Va82kITwbxVeUPVxT0PaN77bJ+29pYjRgOSjQ+p4glQdDWce/e+h2XbXL1wTcM2sRAXE3SgDxyX4sq48y1AoBoBld7CUZC2UdckaTkyBt0EPMjDxYwwo9Kbld9QfRMLcRfhdHoKYTLhYL2UmMXYw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:46 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:46 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:48 +0800 Message-Id: <20241029120956.4186731-17-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 84447fa5-4d8f-4722-1b2c-08dcf812dc27 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: Bqm6jqTSf9eBAuUiIlyoltORi1D3R6pZtfZ6fBGsboiOPP9JCCutv+6IVrDw+4UuORXWYqa7khpAFWhNTJT1o1e0apVHvzrwcvqVu8HFDF9zIzxFmhVIUcwoYKiEpPG91EBtQ/0ULOHBLlCgAsy2yQfvFGHTBHVAlw/E5zZRM0if0L6XaeHsPmlDojkkn+JCuvUrhQ/gVrCJRET8Wld6mJ5tcnr4EDa+F9fgeF+Ub6Ij/z7CqlXoF6G1+lL0ab48i0kGHlQ/esrmZzriaVD7ga+druLqVptyjkxZh9CzAfwCBONKeaGLNp0xT9eOjlx0XfL4mR/xLkyvek9+EbE6tYBf7eOS1yhRL5J6odOWgCTtpT8UEVG4zrh36vg4HJm28tYnmqTmm4O+IzBLHZAgDzeEtRGI2wTTqI5TtVdUCvP3r2RuJE/2ars2OXnSVbfSvTaTKJZwKcm6USjnQrZnweGAcyHbZ8nHK3DTR+Rc6aRDw+mxHSlO4ASkjf/zEr3s8fSPO3x3oOZYO2hJIA2akqtssdl+dL+ypUftDGH5lBVj5gdknzZHgc3u8g2TghJIzp7XlTbWc+HhlTO0VMoLSA753P5Hp6vjH+4UUn9BQ5Y3JWLpFdDZlZqB6k5M2oLmzh52Wli75REt/s0HXWkkpErw0w+c10d6CcnE14fbIu16jTPFKcspYEoTF86JEIocI/V+5Y4bW4TFnj8f+fBVWbj5yvgL4lFhwgJ/6VrytcJ99z7yOBhHnSpBCsvcxMW/qnTRflmIEFZxtCLbunJZGPPs9FPpZwnVY52fsLzOL0EOTK2w0cwpHJuTdtZ9TLQFx0EGW5wCFs1D0xsTFyv1ZwRskpwt1bdSxAY5pASKp0K8bQ1nfpF7gEU/p6Oe2FoATmcVB2DCFCKzKCR0z2KFEc3Hwq9fDq0VMIhz309LiTUHsWSol42/u/DByKZ6YL9KNbW1DbeVT8+RkTIGaKo7xJZ68GKyNt6gnujEXZvAEez1I+YlLxbp9v2FNJVbio2S3syyEtOR7z6YUAih+oksDUUB1VKH3no58Dg8C8IhTLB7ZacLCwatSWkffxn739Zy05LNeIb6Df+AIT8/vP7JHOL+ocHp5tIe07rraQjuX4qVlMRlRsT4BPJrlL1wlA1xnlWGS7WBJ3K21J1MQwE0OG0H8fljtuLQ0axtASbdiDlcbpmJ/Nv3KUFJ/+abCydfA5b8k0oyEg7aBmNdlLzo8CgyqCc5i8z9MRrcze8iELiyjgrUWDHSe+H1SOSr3vMIhxNA08DdLTAZU/FTC/qirDxaE/irF5Bmxi9o9mFS5m0jkGnQgtkyMNTz2Zz313gTbNnIi0maHdqyb9/wpQzxxecdBPLBmBM94EQDXLYd+eo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +L8sUWm1XFsVlsfa+cy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Gs3qRnFhJqD9jhUvrYs7Nq7YBpvEL4mhgFgFwA+Jhh3I0rWdOtDydTxxWjfTu84fSTOl5q3+6WiNotqFe2Qe+bHifJbDtBgLwGOPJO+p4MtNoX/TClej/JVMsNFpww87kG8y2cvtvJt+99dkYsRDCE0mSDqbpqvEcDHJdi1l6x5tFZEMK9pPDymBE6C9TZYCD5hc67Bz712Nm7dEwH1qRNNTokfE5yajusVZ8okOMaJ/ycIyo0sXGuFCn0FQ395EvQATs9x1PJtC4szxBzvbeflCWtD9a+OivcbNJkvaPO4pTEFHwr0H816ORKq0oeawZecq+AGAw+WpQGlpgRLbcYabEG/Gw8tOMoLi/KkPTm8TPcUYVr/zCPwV/iohItEsu6OfI9LwqxbiWzTagWekrRctv8jLaI9xAUGSEuWDmm5lfMkWOTvyXW3O8H4NN8p3hw64RJeSXW89zqzTd5KIyeWaGtTdQOsWyq0GMyAJl551LH X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84447fa5-4d8f-4722-1b2c-08dcf812dc27 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:46.8090 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mq5jWAhCq9LNVjEHg1yHREPxWvGamuRIy20GcnkvjgRkasXTXyuIQZtrz9NqT9u9Cf+N5F+ZGmYZ8m69Mzj1ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lKL-0000i3-EP Subject: [f2fs-dev] [RFC PATCH 16/24] tests: add fsck testcase of fixing sit entry valid_map X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_sit_bad_valid_map/README | 5 +++ tests/f_sit_bad_valid_map/expect.in | 35 ++++++++++++++++++++ tests/f_sit_bad_valid_map/script | 50 +++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 tests/f_sit_bad_valid_map/README create mode 100644 tests/f_sit_bad_valid_map/expect.in create mode 100644 tests/f_sit_bad_valid_map/script diff --git a/tests/f_sit_bad_valid_map/README b/tests/f_sit_bad_valid_map/README new file mode 100644 index 000000000000..5306bdd31ae5 --- /dev/null +++ b/tests/f_sit_bad_valid_map/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject bitmap in the sit entry of the blkaddr by clearing its bit +5. fsck fixes the bitmap diff --git a/tests/f_sit_bad_valid_map/expect.in b/tests/f_sit_bad_valid_map/expect.in new file mode 100644 index 000000000000..e1a287825d56 --- /dev/null +++ b/tests/f_sit_bad_valid_map/expect.in @@ -0,0 +1,35 @@ +Info: Force to fix corruption +[ASSERT] (check_block_count:x) --> Wrong SIT valid blocks: segno=_SEGNO_, 512 vs. 511 +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (fsck_chk_data_blk:x) --> SIT bitmap is 0x0. blk_addr[_BLKADDR_] + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Fail] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_sit_bad_valid_map/script b/tests/f_sit_bad_valid_map/script new file mode 100644 index 000000000000..0064c26979d8 --- /dev/null +++ b/tests/f_sit_bad_valid_map/script @@ -0,0 +1,50 @@ +#!/bin/sh + +DESC="sit entry with invalid valid_map" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +offs=`offset_in_seg $blkaddr` +idx=$(($offs >> 3)) +mask=$((1 << (7 - ($offs & 0x7)))) + +val=`$INJECT --dry-run --sit 0 --blk $blkaddr --mb valid_map --idx $idx $META | grep "inject sit entry valid_map" | awk '{print $(NF-2)}'` +echo "valid_map:$val mask:$mask" >> $LOG +val=$(($val & (~$mask & 0xff))) +echo "corrupt_map:$val" >> $LOG + +$INJECT --sit 0 --blk $blkaddr --mb valid_map --idx $idx --val $val $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +BLKADDR=`printf "0x%x" $blkaddr` +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +sed "s/_BLKADDR_/$BLKADDR/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F5BBD2AB33 for ; Tue, 29 Oct 2024 12:27:37 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJw-0006m1-Cc; Tue, 29 Oct 2024 12:27:37 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJu-0006lk-3T for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Gy5s7n/f9sXm+lK7/nKIBoASAqOkWzuXhnAl2Y+nuf8=; b=A+sCxy/6TJRMPrekO77M5xyN6a EK8qxut/6ahI/sHnpSBzgGv5qiVA49/dRKpBvApeigeqbuiokAUbNB1q5riJS+Thg6XGhw752vrMX roKy8APCrCxxP2FpPw9uN1mRj+vKIaHLg9KcNLXJHGhPYQwpPCTF7wMUDPHweoEawu9U=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Gy5s7n/f9sXm+lK7/nKIBoASAqOkWzuXhnAl2Y+nuf8=; b=i6qEM0PfxWA7GWLBdw5o6i30Lp trh5dpgZOic63me0pfE7wNUQaI0p1j9iLxa4JOqFkzhTDyJV0YZvTM4ppWm/9kd0Ramz7dP6fotOh m4quK/+Fnq5RT27/kFNO6JbMbjf/3AnO3i5/KzeMHUcgygM0nOY6GmBroEp4Vs3gwR78=; Received: from mail-koreacentralazon11013071.outbound.protection.outlook.com ([40.107.44.71] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJs-0000f1-6G for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UmgaQInFxhpjUzvZ9w3Et78/QE14a9Z8Sq7Iz6UsitfltQq4M9FjnnagIDSf1+a3SyPqmK9YpgGO4vkuAI10RgMnT1PxEoiC9TVwAcuFYR0AOH9TLm6OT+ixJdSaqbR5NJJWLkjInaVwbbig2Qd69KBegX9oH7O3/ITRARytq9sof3T8zAUtbdCBKbEIH8f91UKGtv2WOWO7mavyJag3JmoPNB5RtJlJtkXPlmf7vbRJWAdXC33yLlaYwhmgbIHLRQobwDY9qIMV1Mt5UF5i1aq7zYx+nAlqi2CDewOJ1E8FLzjRQ1dSbHz2yb6z0SegD4zKQZdAEeKQ1EImhFmRlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gy5s7n/f9sXm+lK7/nKIBoASAqOkWzuXhnAl2Y+nuf8=; b=iV6ld1FrRsVoZ3d/Y0rt4IrZ8PfZiTYdDIzhVkvRVRKls1OA0ZISBSKwnl89MnLnp444R56/61F1QGiJ4r215P/teZK+IFpYO8LxurJWwGJrB+Zrw08NSIApo4BVQ3RPJIq6IaH9JFL6vo5LKODEqpjGSbvnkVyGuk3n76BY+H7SWZiwkecmIL71zYDiVASOzPfI6N8UGjJstShNmzyxIDKk5xjOq0uZ0GcxmVeM52RzRkqnvRkQGJM6oEeGHacuB9gZ0g79BXEX/YSrr1JQHcq14+NlpAveVrDVWcr+Q6Ahr0ViugJvrcQ/obUoNdr+aN34X1PsjOfpG8zQ34RhGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gy5s7n/f9sXm+lK7/nKIBoASAqOkWzuXhnAl2Y+nuf8=; b=SIkCvWjphoJ9MJJRJO403cFkKpDpTRwc6f1n7wkfUJRkUp6ivO2ucRu6HXROAg50FHRICJGqdkuIvCk2zyPKxtZWP2JeJ6rzjPPmHeD032q8o8xBvCb28FYf5p+FhR4gcYR5jTZeQ9xpH9oxhq4SpozvNE2ojmoLQtoHUz1Y46M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:48 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:48 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:49 +0800 Message-Id: <20241029120956.4186731-18-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 32fbd625-fb75-482f-3337-08dcf812dcdb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: PU1BEuof3IbRglevsayzhxld6C98kH6XzznM8Uf/JaNJ1oC3GYozWmslnfu6FALPajHaXzg3ABl8iZI2DgHBDE5xhYG0ElVIhDOS8AB0O5fXizcwARImsfotfXF9Zs93iufF94c9uW9QP+P0K/rCoKDXHA2YoDPHCZZCFZwNyPszp6ryPyYa5BXf9cEPze9ER57fTyAoD1L+sQzIeA6rrRD2AZASlTPjghumslzkbOI2MeUFPX1CJm15l6kZJvzT3vY3s0TmNsEMQailRAdplyVI0LNyULtLFAxyJrIOz/6Yyrjjoys30EhQB573PFTCGhqo2UBG1jEjt5Wtqz1pyJNK4QeALT0AArP79MdE0iY6J5AeSdjgHuRUokJbx1zjegI2g1OrD4BHjMxGyQIErXbTn3p9+lbuNP8QdxkKXqHrV9gcBegDsUgT+Ec+2xRJgmOHE5Veibh8e5ojvA8YSNICpvq/s+aRTvKO183vUuNrxWPeyfTMntXEt54QaLkBy28K8/ve8R7m86OuzDzooySk3Ah9TiGXzEBt8gRKnYX3q5V8N2jy7CcKLqdQNiKDyOaKAPnXbWem6Cmn1TZYTfesQspqrn9YyviUSdpVdOncOPabCjtKzqQ4mUsMF6n5mP5G1T3pP1/8SGpajDpdOT4erWXtT9wI6B/8/RPs/rTgagOWNj4uoNfwncJWmvVCKeFw2/8YkIPuNJMYKV7MZB/A+4zJwfSfmhMkgEzhwUYqDlkp3Z7LxLK9VIWZTDqEIOEWu5Wi2aFaC7nthCA8TuwuUjcRNqh2LkmS62xRmfivR1PxebHMuD1UAMtN1rd+pVt2u0xJaq1emuC892tPOwqfJHsw0HWulUr/BRVqyW3cWl6AhrpOXXx0ZijlS/CdUtNZ+3g9ZAgGAhm1TPc5pDCRm4o18qTk7zhoNNMgsQZKdTGAXhv6kywu1hpCjx9Ve3+WWzqpw2P3g9lHSGhMY1yrk/I/0mMW0/YN3u/98+/N4PMYbl6GDtjqJPTxHRO4/RzifFjTISp0pbTJKax5PQYfEy7fiZkTi/M7gmRza2DPHvliSX6nqjl+s9ZHXWYZ5wr2auqWo9GlxyPFXFh78hDP0S8GaW63LcPJyyru14r0MequnpHTLM1ANJW5jyWTod+4CFsFCVUnVjszCBrc8c0BZ/KI0r9GEVsvhicDkOLcgLTEu0oFUf5vZJtL/qkakW5hMm5Bcg8M3pbZ2udDfK9OPNqA5Nyo2ZpAr2txbf3o1v3yVwwHa1vTI2SIZ4VkK4Qx1xNWNKGKyW8E6QhYghUMXUFwX3UWb+vEt0p3mNDP2QSBYb1z42EvnVIGo23DsmhF+sTz0cDJJtXMSqTlaGxg1Ic7yiH7L4OifzBPWYE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I0vveqL2jw/YEpFWvrNJ5nIYpu6GDxWBtMfKEnbiOJw4AiDy3f5+IJazs4uvXLK0XwQC7toy4gNlF0K1BeNpDSAASzj0P9KU7JoQ0VU/b/W6GUmbo96mb0JViVoMvRq5q4ljAkNO143PbsLgqXsle0eAiSostEAO7AM948+pvE4LkPUzHGC/pdmYrFP4OXVyga6iUINuG8IXh/y3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iw+94YGHq9MmHnLQAqS0ePzEGJj/Jg1GTARum+eVyWbefGwefedKyFiv/q7LURAl1ET86yW6g5Th00NnUzeCmpd/11CmUG0WKu4wtNE+ercaGF3OMJ3qtdACxzf26Idqlx+uvdvpBo7rKxIgzY3taaMXaYNM2Akx11GcUFSXzN4/LlXVmGg+aEF0Fdu1lWs8t7GjwKGw/vQaj+B/fFze6eWI1CDsGn4Sifi/chJ+SQK9GWxrIDoYU4KoIibBOmTnWwdF0gwN8EaabQNqlUOBqwEDCRQc/LyPs1vJfN2J0P5DG/lHyXrL3mapBvoiH X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32fbd625-fb75-482f-3337-08dcf812dcdb X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:47.9937 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qXK1L6HEIXYhlyOu06g8vQogSp3IDzgFiIe1LjHbi11fPFtV5+poW+lRI96rEZGAdbmndveokpC+OIuhm8bXeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJs-0000f1-6G Subject: [f2fs-dev] [RFC PATCH 17/24] tests: add fsck testcase of fixing sum entry nid X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_ssa_bad_nid/README | 5 ++++ tests/f_ssa_bad_nid/expect.in | 34 +++++++++++++++++++++++++++ tests/f_ssa_bad_nid/script | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tests/f_ssa_bad_nid/README create mode 100644 tests/f_ssa_bad_nid/expect.in create mode 100644 tests/f_ssa_bad_nid/script diff --git a/tests/f_ssa_bad_nid/README b/tests/f_ssa_bad_nid/README new file mode 100644 index 000000000000..d30e41c77c63 --- /dev/null +++ b/tests/f_ssa_bad_nid/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject nid in the ssa entry of the blkaddr with an unused nid +5. fsck fixes the ssa entry diff --git a/tests/f_ssa_bad_nid/expect.in b/tests/f_ssa_bad_nid/expect.in new file mode 100644 index 000000000000..a3a6c94993a7 --- /dev/null +++ b/tests/f_ssa_bad_nid/expect.in @@ -0,0 +1,34 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (is_valid_ssa_data_blk: x) --> Set data summary _SEGNO_ -> [_INO_] [0x0] [_OFS_IN_NODE_] + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_ssa_bad_nid/script b/tests/f_ssa_bad_nid/script new file mode 100644 index 000000000000..ae57d979d148 --- /dev/null +++ b/tests/f_ssa_bad_nid/script @@ -0,0 +1,44 @@ +#!/bin/bash + +DESC="ssa entry with invalid nid" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +base=`$DUMP $DUMP_OPTS -i $ino $META | grep i_addr | head -n 1 | sed 's/i_addr\[\(0x[0-9a-f]\+\)\].*$/\1/g'` +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +$INJECT --ssa --blk $blkaddr --mb nid --val $(($ino + 100)) $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +INO=`printf "0x%x" $ino` +OFS_IN_NODE=`printf "0x%x" $((0x100 - $base))` +sed "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_INO_/$INO/g" $TESTDIR/expect +sed -i "s/_OFS_IN_NODE_/$OFS_IN_NODE/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E177D2AB36 for ; Tue, 29 Oct 2024 12:27:01 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJM-0004XR-Ms; Tue, 29 Oct 2024 12:27:00 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJI-0004XH-Nu for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+mzYvaSGdftukYj8lwUFiZIiAT74u2p/Sv18OTsH1tg=; b=j/VTP/6gsNMOx6qHLepdPsodUm BrVUMepdZQBgn9g1+Q0QQfCy33dhc11aJu5Sz8cD68PKjmrY+alMBiwTRZhaOvnUL0x2S5BlgvSEt XUznwW5tq9n1So0S2zeg55XU4H2X6+dPyFcy9obkQKaszoPAWAtwNUEID/OipsbFDWDU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+mzYvaSGdftukYj8lwUFiZIiAT74u2p/Sv18OTsH1tg=; b=D7ZdOiQyW101ZE1i/2BG3RnU2L s7T0oyYYwHryYhvClAoBiBot4dYZKoU7/2olSoqwyxSB+5GjlUS+GZ18bZXXzM8eCvdazQdf+d7gY nBdc9/g3hnTEGZ0gzkJrD+W278eQIJpfvisfksNlesDkpU4cQrA4LmMw/C9qiKTidL8M=; Received: from mail-eastasiaazon11010057.outbound.protection.outlook.com ([52.101.128.57] helo=HK2PR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJH-0000bs-V2 for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x4sNLuu7WAlWyeMHPF1i4aYCBd49BszozDuxiv9cyNqQD4Lk1ACfoGZlM3HxuGOoIu6Ly1kGGX4cIW3wGTWauBx8bpFw0+FZFNcT3SM6n7dIr0AAHVgWXnbd50LEZgSJTuw8y8w1Qw5DZc/MIXjkR6NHTo5rDQT4C7y0q1ulwVoPyDFI6C+WRi49ODK4A5xBC00GFfiIQFLfPOMXB3hpeWS+8jDdYn27rvrNydM9ytC/GbvBE9G5DA4o9hgJ/nfMw2qfaVuU/5AsZ0BpAQkO4iNahr9E9DZYe0pFnAUblmWnzjlKyh6ogY1dC2XHrrWXORAwCNl6i+pVpjeukxEdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+mzYvaSGdftukYj8lwUFiZIiAT74u2p/Sv18OTsH1tg=; b=ybIdMooJ8Tmjkq0zMR1g8s/sG4JCcHB0NwH0y9SX3KPjQ3T63htUR94SI8IE32SLObAA+2lpFArGch8JUa7q64LFhyIB9kUMvIVSIjAocqhWaiKiNysxBB3nQlFd781Xf4/X9xsYdf14yhkAGlJ1wuMwrGMO3N7NDZf/1PIkEk/AlBEFQKAjrF6G8NvVGfHYMSuqrNnGijLrKki89RkMx8Tzld7ybC0EeDoT0Im3izoQt4QtGB97rTZtt0Eb1Jth0zVfD+TSdFW7BubMQosg59afu9H/t2cJ8LaeXHXopZHQE92BCgtexXRD5zP/LK7w3Tzhl9rW4yoIAGQ75+aMKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+mzYvaSGdftukYj8lwUFiZIiAT74u2p/Sv18OTsH1tg=; b=eT5OO00bI7o63xZDtaRc1g+e2kWheeQoqC9C3Ph4GhmRS2UPZgdZeRAnqPdrI+8xJ2CR0dfG++L09+5FLuVuCA5Jx4F/G2MXMnuKCSQ1yIsZMB6JtmMjtMGIZfSnDQ81fG9YyDHsrbFIu15oTFp0Xl7T89quWpU1TSK+Kq/icgc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:49 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:49 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:50 +0800 Message-Id: <20241029120956.4186731-19-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: e5fc9b5f-a6dd-4814-2161-08dcf812dd90 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|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K3EaPf+jfR4gDOpAOgavMNaDCiNaLIhavTDxPLcnRKP6EekgrlBt4d54Unwi4or2p271z8Z8XcYIREvH3dQK+etLPFEDjO5HKeIlNCPJJLRCJxcKdMDyVbG8liQRixuKBYxgrxSbYOWKRWDND6NbXPwdOntNRTw4gF3UPf0/DK/Edzk512S/8o1uuxboGKCcsSZm7yN0QDAyk2NFoiEaXRy1jypU1w0De89eIApGdeTIPD6ygHbejyELwwivRkNaVGpVjGLluRyYaZae6wLoze6CA/iQUr7xlR4VG33qlifxsxup1JAAgx6iAnAxNSqVtc4VI/1QiAv0Xa2U= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HHhkOtzJN3G+FCxzpaoXe5iVe1PNQIE3GERYaBcYPBSbCN3rX/NPxcafnXVnwgzrmXTTt6oP0lq3nmaSU1RhAWLKs8pF9ZOAIOVt92NRJU2ByaQSZJNbnZuVNtAoR3CY5DfVersDQHIgoKx6UAq2waqcfY9Q5uXEWN7Xo+qvS71lYPRHDS2uQYSmJ+BZJenKCUrU7jAskxqRFoUR7kUvubM2fFNh/kpafVlYm0c5l/qtbghfhka/oqSlgD8rFBCNFZY/WXRBHtlru7QNl++RwNgxBoqINo/u3f4NeQgn1m3LpboBpMdczjCFkN8dKgcvWzD/bkgcm23h7czVti3n1mD4BNuPlEN1Jv0ubWwgcyMhtFm20+N2ppxzkXqWKPbzpahT69DzR1S2/N973M4m/4Ri8VUvB5o4egwesuYe6SyxdiW3P3CAKViFPf7DSV3RTzN06ce6W99IYy1+s5lk516WlHbxDGK1ACqOmDpeU0lu8a55JDELFaMKbdmU1CzMzHQBGosyJlAtZp86XcRq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X X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5fc9b5f-a6dd-4814-2161-08dcf812dd90 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:49.1849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BQnG3uRFnuZwrwmyMkD6E79kTlr2OZ27EWrOpnNRXpydVHs/70nqcXQPq9tUyQWsz8vVLqcPZF52GAHbr+CS6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJH-0000bs-V2 Subject: [f2fs-dev] [RFC PATCH 18/24] tests: add fsck testcase of fixing sum footer type X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_ssa_bad_type/README | 5 +++++ tests/f_ssa_bad_type/expect.in | 34 +++++++++++++++++++++++++++++ tests/f_ssa_bad_type/script | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 tests/f_ssa_bad_type/README create mode 100644 tests/f_ssa_bad_type/expect.in create mode 100644 tests/f_ssa_bad_type/script diff --git a/tests/f_ssa_bad_type/README b/tests/f_ssa_bad_type/README new file mode 100644 index 000000000000..358c0c5ab284 --- /dev/null +++ b/tests/f_ssa_bad_type/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject footer entry_type in the summary block of the blkaddr and change it to NODE +5. fsck fixes the footer diff --git a/tests/f_ssa_bad_type/expect.in b/tests/f_ssa_bad_type/expect.in new file mode 100644 index 000000000000..d0616d8ad3e3 --- /dev/null +++ b/tests/f_ssa_bad_type/expect.in @@ -0,0 +1,34 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (is_valid_ssa_data_blk: x) --> Summary footer indicates a data segment: _SEGNO_ + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_ssa_bad_type/script b/tests/f_ssa_bad_type/script new file mode 100644 index 000000000000..3f71e1fdfb93 --- /dev/null +++ b/tests/f_ssa_bad_type/script @@ -0,0 +1,39 @@ +#!/bin/sh + +DESC="ssa block footer with invalid type" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +$INJECT --ssa --blk $blkaddr --mb entry_type --val 1 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +sed "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect.in > $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED550D2AB33 for ; Tue, 29 Oct 2024 12:26:24 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lIm-0003wh-C4; Tue, 29 Oct 2024 12:26:24 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lIl-0003wT-1w for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VvZSFVU8G4lYBTsMjCjSOcByqZKQ+STlB0oq2AHmrLs=; b=AARN49BTjX0MVMj/TVYlb8GRkM BgZp9FBL7GEV9/OwtzfWCl9gK3Ox+uJDCj+ZHS6SPSKPYj0KDduGtqGU0YOpbah9LLO+hp9HrlVmc j6ZJMI8bIsx+rd3MFNBj58bMzU2+hPnqi6t+0ufEG6f5Fto1/1gyu2ijmc6r5KQLah38=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VvZSFVU8G4lYBTsMjCjSOcByqZKQ+STlB0oq2AHmrLs=; b=O5+hLcti1s7fUhhOMUHvezrdGD 6VNGDcvy+2354MfzXRmuUAatygz2zwMVMp79hcNC4ljgNkKOrlBEg7jdou6O3axTpWYMETdwZE5Gp ymHPX1mXDrUNHqqKmQhwfqLVg2o67SgPnV17jy160QC0HmtC4UziVeOredV4AUpkHVps=; Received: from mail-koreacentralazon11013056.outbound.protection.outlook.com ([40.107.44.56] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lIk-0000VE-6k for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:26:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Inv3fhSTUHf7Mt/qyNC+DbIgZ8EdBUXazW/vTTN5njuYUixJxu9araHx3I/XcrNDXEJC26swN+SfObw6C9y2SGYLDPuBYAbYEhnZlm3ZKc+cOvKygc2MlAAb/VfOK5Fj2P8BGqwGBsPiODzqdLk4+M8vDoEFZLsrCwyvN4DCNYqHwU70jag1JjwguyF+P80KaeVRxnWftoYrjRB+iqDwcOXa1fRmJZKa8rNkKj6EbLdaG0JFD7MLQVOPK6V10l5Q7aayygJn1ZEb9K1g4siH5ItXNAmYH7dzXJ9tREJ6vNyoT4noNjmU49vuq8VY2pQAutrHnWVfIPJi9vRN+Yxyvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VvZSFVU8G4lYBTsMjCjSOcByqZKQ+STlB0oq2AHmrLs=; b=JKcHVrCOq1ZCJ0s3Wr2CjNRq4a6aZqZ2PziBUiXvJmnKhbDgZejmWHtO1AJTFFGO///zkmQwW3RxBTxirl2/y+JOufYnyJWlwWb5A+/MkPliZJcSFy2Qw97zL+iKryOS6aoIaLyXrMSMWnQYze2lo7QcUHJLI3tFMaa4MRK8+uGMgZ38Vb0MWfyKWwBRNT8AqSs+njJX8qvIJnGKqYK+YQjGj+UmIaEOymxyahFy9pxPPBwZaYX3sdkukFoueypJvWqgO6BLsBdUS2IQ5J3lfXu/2PN7pMIoit26wwdPf3Yi+g0+Ig5ZlUX7QPzdtVU9+VKj63D5L2rOdN8+dv36aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VvZSFVU8G4lYBTsMjCjSOcByqZKQ+STlB0oq2AHmrLs=; b=BEzuJ/WAwO2QOVozIGIwIchOp2s+7qjEuu8j7G52U8xL/ZS+ZSzP7R8D2hnqTMMuIcREq8MgSjcnhCJcboPtJ4vPWxv7OXm7pWvFvOkwBgvZ5gpAaiJX4N/zWBHIhzTjCrjmjEsitjo5amUtH9KuX7Pa0aNZieRart1fLFpBW3k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:50 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:50 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:51 +0800 Message-Id: <20241029120956.4186731-20-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 16658ffd-07d0-498e-bf22-08dcf812de48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: YzqACBfRZSh26xE1nJkN25kTN4EfJetDWYAhOE9Jf8C2+p0/sQpZwIIHl5y9Oa4Q73aYIgselfKmNr9ZcW4KLoGVodnHm9G4vWt3pRNu7hKg5A4x7Efo5CQ3wb+vxU47iKlajX6ALYgK/aqVmXOKyoELwRwuQnPl592Q5qdqS5v9IjkuW03BTxAj2EDyyQjqiokuv9kS4icRrIS2IZzwARwmAUVTpj6mXy4rGucxg3O699pM+H2bKqDxzF+pbgxdmMkD1WxwsGeBlULv/7IcIHSJgYuau+OjyPm+qpZYTmsr9ayhIexI1YY7atHPUBJ5Sleo5wfJOFe6aju7c8G0IhirtcyOEypfQEtsqk+OthBG9uqK98MV4INEkuLkEKU4wTRtnYpSviPqajvtQhGYKn6qrz9aESzXfY0LNCcSX4gAMFhSjICbaZ9oP7+wriWNIdXPXmIVlPBVsI4SSKWmvK20Y/hoCQGoR7NyR6iFE98GQhzQVAgLSv+oPDKN/z6ZmwNYSKrvsz6Q8u82f0g6oIumcOgmixWOM40rN4y3IIoA7IHHDp7665wvIMa0KjVMUli2QSochu25FJojw0zzcBXoBkgi+skZzfqVJjTO2r1nyHouEYY7+Mdxq1gICKvjyr8nLs8jkxHUOGU6rEB6Zy/4inv892tMjaN5MzQTXQ+zSiT1BiuIS5twRPtQPwJAe7GY9WiFS9XUFzzYmtQkWuobWGgrRBTFX/hv8loMRaVgslZzyBQGzIX5GGZz0SLdfHZy+dY09uXZqI7ITHRf9DtuMwZXWsB5vfe/Qty2NN8WQmpDP6W+iZpmS2DSK+1jB8yGV75wiXT82e2wrHiam0uccLGKNwD+N0LIsPt6ryHn+iL/4cNTnaGcLvfYF2QPWrvcOzCqIH5Y76V1j1Jn2aiI+ABpnJ0Yd52fofz99hdJtFpUbNEv16pkFE4jsjwtzPDwd2ACRJLvSQ/60cCqczZA+dMCvg8EoCkk2GR1uaetySfLq/TPqTfYJPyFmRLuWievWPxWDYcV5wffyi9Kx4nZsEgd5ICxUz/qADkhvRmRp52wUmL0Na63oWdjsxHiwKEsBc+Yb48cCn08FfE7mFpQd6P7acgr2eb8gXI3zDxDR0cEOpkwSci7IoS1Q/Bxo18oBmGMmLeFtQ4A/wmk0YTZu05VxvbK1Q4ZAbZu1X90TdlxmL87NWOpGQ6FFE/X8GnA92NPBbcVWe6QQ8iX/T4NxSsmK9kjSStD5O7D3HvGNW4+Sm7S+ibTNJ6Nvqy54NaSebIwHmhYn8JyzzpkcaxtEAVNt2fhi84kEVxPkJrPLS2yYRr8tdt3bGgAZeMvp3UMj5Jntezo5rUx9vkxyQPSNnPjDsgLU2gCX/EKEAM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-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6xuIz4y9rRe53nWiF0X7R9iuBezFQHOfDu6JVw1n+ezA1rx9yPQyEJJI9tXjC+aKVxSnf2A7M0bTuK+JpuCCR9842NDk6gwFnhFeIpkuATwPQbywjbofW76r2X/E15J9Iu8Zo0b0LFdTvItQfngAEENInBbFUbwT1N3/KQZlxXiMGic3qhnO9c/QA01qOK1GaxIxVRArGM789xKWz7RKAjwbBmfiudJ3Ar4LuJkXeQHVYfUS2z/hc8s2BXaH6yPxVua/+CoOxyMmhVW7SqgoXelC82maurqkaU1i10F5NqHaEDZ0A8kiEOTd76LudMBTNpTdWqCJu0GjqE9VZ+jTjbfTAlZyudkcSHr2TXWEvW5u0rlOtEV5Qlg09W6V25CWz3evAZh0vNE4UmJRbdkLPN8jkjEAdErZYWTB2HsKRBjAYC0NI8R6Wy9/0loqf+XaiX1N9jWEAiwXhgOL48zpLVSQf0tqiL9hy2a15qjCjEMCuJemlG6OwsVya0jWuVGBRyN9zfBmtn0tWEgB2QTEi/yOjFSgmiag X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16658ffd-07d0-498e-bf22-08dcf812de48 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:50.4095 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8VSCnb8kcSICpJsQTvs0z/Oa0060cw+lAslxYVfVa4b3ATUF5m310kmRvgoBL+WbZMw71tJp3pYy86/FNf8laA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lIk-0000VE-6k Subject: [f2fs-dev] [RFC PATCH 19/24] tests: add fsck testcase of fixing sum entry ofs_in_node X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_ssa_bad_ofs_in_node/README | 5 +++ tests/f_ssa_bad_ofs_in_node/expect.in | 34 +++++++++++++++++++++ tests/f_ssa_bad_ofs_in_node/script | 44 +++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tests/f_ssa_bad_ofs_in_node/README create mode 100644 tests/f_ssa_bad_ofs_in_node/expect.in create mode 100644 tests/f_ssa_bad_ofs_in_node/script diff --git a/tests/f_ssa_bad_ofs_in_node/README b/tests/f_ssa_bad_ofs_in_node/README new file mode 100644 index 000000000000..65fbf6aa4f1b --- /dev/null +++ b/tests/f_ssa_bad_ofs_in_node/README @@ -0,0 +1,5 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject ofs_in_node in the ssa entry of the blkaddr +5. fsck fixes the ssa entry diff --git a/tests/f_ssa_bad_ofs_in_node/expect.in b/tests/f_ssa_bad_ofs_in_node/expect.in new file mode 100644 index 000000000000..a3a6c94993a7 --- /dev/null +++ b/tests/f_ssa_bad_ofs_in_node/expect.in @@ -0,0 +1,34 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (is_valid_ssa_data_blk: x) --> Set data summary _SEGNO_ -> [_INO_] [0x0] [_OFS_IN_NODE_] + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_ssa_bad_ofs_in_node/script b/tests/f_ssa_bad_ofs_in_node/script new file mode 100644 index 000000000000..a9d17e5d045e --- /dev/null +++ b/tests/f_ssa_bad_ofs_in_node/script @@ -0,0 +1,44 @@ +#!/bin/sh + +DESC="ssa entry with invalid ofs_in_node" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +base=`$DUMP $DUMP_OPTS -i $ino $META | grep i_addr | head -n 1 | sed 's/i_addr\[\(0x[0-9a-f]\+\)\].*$/\1/g'` +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +echo "ino:$ino blkaddr:$blkaddr" >> $LOG + +$INJECT --ssa --blk $blkaddr --mb ofs_in_node --val 99 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +segno=`get_segno $blkaddr` +SEGNO=`printf "0x%x" $segno` +INO=`printf "0x%x" $ino` +OFS_IN_NODE=`printf "0x%x" $((0x100 - $base))` +sed "s/_SEGNO_/$SEGNO/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_INO_/$INO/g" $TESTDIR/expect +sed -i "s/_OFS_IN_NODE_/$OFS_IN_NODE/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE297D2AB35 for ; Tue, 29 Oct 2024 12:27:20 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5lJf-0006kS-PH; Tue, 29 Oct 2024 12:27:20 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5lJe-0006kI-FM for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=G9tLbvTT8tjrufmCDXE4FFVf1eRlaoOmPZre1Z4buwQ=; b=nBvsvf+RY6kzjH+2KlcZJxu8BX m9n5XP8y+7G97FkjoO0csDBLUQptjiAzOWbTvbeNByQ7gznZXAenjtVgkB1e9/13rIMsHSwoaXrUN wIaIejiltmxOLnRJU3TAEH7Mc0foEIhyBb0GQWiRnEG9qKkJE+wNB2M/PKf8rBuNZEuY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=G9tLbvTT8tjrufmCDXE4FFVf1eRlaoOmPZre1Z4buwQ=; b=QltI9EQfyz1Cfoo/cHST3cf7Cy DgD2YwL77qeTFT3LCqcYPyFBt8ZyqMsZT6WXr590Y4Zfeo2t9mRyumT4sjB/KhA+63chLRFi448iC TqLtfTOpNPkLwmmgBUmX/TYwBj3idcgZwsuXdfysagnRnCNpZBWU2nbTfi/XsEI3sxZA=; Received: from mail-koreacentralazon11013046.outbound.protection.outlook.com ([40.107.44.46] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5lJe-0000dg-EU for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:27:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OPmziuZkNanTGyYlfi4F4u3wXNOV0GtXODpykqkqzFUQnWok7R7siN9T3vKV/YSb3/kY8PLF4gUk6nvgt1ueOqsHXxIT5o2Tge7V/ckCDcb3VPkuEyB/NkPdGBGPnP6RcQRqTDkUgQ+ElcsTK+IAvuhrnxv9mITm/6DNxaerh/PpxM2PkIZUOtJo/QxgHdPFXdlvHrekUB8gO3DgTIpsb6AM6ufh75VHrGKdrCIivBCJZqNyIOLxJUNDestTzalV7uX6BKrKzOWBzb2aCHni7Qk/DeXxjpsv044WXWMZcqBj5VyCzjt0tsY0SoP8lu9fZqEd6OFoCNcK4oEIx2JzYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G9tLbvTT8tjrufmCDXE4FFVf1eRlaoOmPZre1Z4buwQ=; b=k5RIoKZeP64YYPGTEonwGui2YF0mjvukSDIr9NXyri5A0uyeSX3FfKDf5Fx9y5nphB6Vy3jV5m1jiEsVfk9BufYI368uAcEsvakzOXWxN8ASTWLX6Z/ROmY14PEfLC/aIXGNePMxDBlLYXsX+GctfQdzYnprMSkY6LcoqHRm3v9my/pYJedeYNDCsu/6O5RKy8gFxAX3aiRRqQQui70vcRD/EyISgYVURugQz6QXqZ/t100VL6Y7StFz4gPiUhgMx+ezIretU38o2l60xwDkeYXhl6OUVJsP69+81wt35jO4XyPpXaw88doHXOQicnzittoCgaiIE1339nBELwfUJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G9tLbvTT8tjrufmCDXE4FFVf1eRlaoOmPZre1Z4buwQ=; b=tBAd/CQUyEq5O4aEmuNTO3atvTmpuVLRxuOk+rXIDpb/iiDmKeL2ok4yO3oPyG6OLibIQe7fn6k3oxkgKmRkMcFnGC5JYlVy3AG3V+piVDkUhxQWYFixocF0rJ3urTJady3/+r3ZEqX9On6Wv9eXvwQyAmzbfdaPJIa2Is2Dh2Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:51 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:51 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:52 +0800 Message-Id: <20241029120956.4186731-21-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ba70151-9c99-4848-6936-08dcf812df06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: pLs6NZ2bIugxHssKhhVQxI/qtd8Sn1qjqBUjkMQJoDFRNMpbSpZqKDrwev7a4Ucw/Xrp/KNsPMXNk06TvVFdQ6MLzw0eHjyZW4o+Yzi0jz5RwVhWn83VztUe8NEQjZIvuu/bVYxw2YRdkrUed9x1uOlXt49GTE9XrRI8ccJVNqLFeYBVu33LS6o1fiBccnv9R+NqCd4Y2a4WV6RXUSJ7f4NUFrH9/lX2KrDzFudbXEfGrwA6XburjSmsBSEhTn/425CTzEl21v/9XZGlj6+kqKHm2ncw8uoosS/jkIwA5afeYVrrylU63ghApIuWBcdCc7z3O0ffN8McxVpBWuRdUpEPFZXEJS1vs9AySx/2K0R176gyUCGuY+ApJfGpRvFtNsbDBOOW1apDN9FHphLx4aR1dZ/kUavFlczpFhwOAll4povJBFVd/YnaS7DWIeKBU5MKOV1J6CjeofCLkp/rVI9X6AF0eK8rAcVTJDB0JhsB/bJJt/6GI6xKd59Bcny9zh6lisPcGPgwhq4kWlZBhWw9bHQt5VXxu77UXyKCVoBQhKKItxWkNMPNaekNgJGOnT/HX2HEicFl/x9OQZH3yUqiQJQLTiqyix1NF+EvA1o5D/8hHf3bI63CNPxhAZKWYRhrG9d9mqstDqIXD4zIgsgPe6d2ZmN7rI+AB47nhRqjfSkj5onedY9jqRZnypsIfCIDSnzZeQOHggJ+j+CC27fofclIjx0HOEhmWuFldkfQNS3rWFLpEjwA26KRGE/kFNoELklG5KYYXKF6wtV+nT45v77dmy3Q6nKKy47HY45q/cM3Nx9phrb7EjLrKXqQie1wA7MQTs670MfbDJYEcmelYwNOixnnFuINGwbP5+bdyXtkBCYdFs23eBt0NJ8r5goYliqrUneKkYD4N1Ng9tk9OFxZkGDLiBLEObCSXBcNs3YksMHrUAKNxwj1ysnEliBl09bS5IWUTVDjUFLuVMCpMbGY1Mi2X32+zxuz6oOts1isx5QSXYSV9iFKmzghU6De88HJDx1mZyGHnAh3xJ53E827WqVZMvj8yG8rJ5K9drL5mlzt+hrDD2DZS2siuSBQlEYiBdlLhxw7Rorzainj9T/pSNNvxKYmLp2Kuieuf60rpaduUAeprhO6kNTyjzCt1iE4mcX7sMjKdosqk/hr2AsFND1R4KyYt0/fpbNz2Xs8lPrKVClVG30EGZtDsXAgZnht7g56HW0yJx+MIlLyD4MM5TMqJByy3zfv7747oRgEd7Xb7QisZD+EMw7JgzGb4a5GUHjXHjgl98xBLCFKSA01dkRWLx4RlvRFuNv6LGl3L702ifjVRSAw0E07EyXNVBcGXNKhvzrY6zWhYdEtTS0VGpT+u96sHZyDXiQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: exo4zGE+vaD7MOOnmCYmvfZwk5wOpaABFEH8gLkllhEKWe0fiT80h9S/pmACMK89vsL4VgyTpIrD0+f9BHbcjuJ24AXu26S5lm1br0IAShOfCKVub4tvSdEjI/EK6dFBgpdCdXow7oG+n/SvGXBmXwT/RHfjrD0GUpeu2R3GHkLrg6KN0izTT06fHwqj2zZxmA54R1EPieBvuhm1e5+XHZh4TXdGSWwJAR8k6FShdTlWqVSEk41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f4RJUDjkEEPQHbirl4LUz1+OFcwiEUIyvdzgR+oNh7Y74FpFwj5cr1sgSBhcTTK+2MibMVjYQ+D893EQzFohlhIjvLgynRHV9UX+G8v9n1VT3PoExdCA8ybIhvlOZIMyfqaWYVoLMe47MB30dez1Evj6ppOPzNpYLVJfwLxpp3adYFsi4Ds1fyTuj2VeO8s07mn/dPOZSLsOHHxtad8856UAhPmKPt6SYAz8unVdHDvO6BepvFKQWVivnAOAdV42IgTM7G+JtML9o9oiNlZpPIXyCLRrChfTN4 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba70151-9c99-4848-6936-08dcf812df06 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:51.6241 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lcfGDIlh+v4HQf3HTNUd6keJAN0SsuUvcOWFwWo1mf52nBpQ4MOS39zoz2tduU3GbBAYcUE04HGRceCObeV8dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5lJe-0000dg-EU Subject: [f2fs-dev] [RFC PATCH 20/24] tests: add fsck testcase of fixing invalid i_addr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_inode_bad_iaddr/README | 6 ++++ tests/f_inode_bad_iaddr/expect.in | 38 ++++++++++++++++++++ tests/f_inode_bad_iaddr/script | 58 +++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 tests/f_inode_bad_iaddr/README create mode 100644 tests/f_inode_bad_iaddr/expect.in create mode 100644 tests/f_inode_bad_iaddr/script diff --git a/tests/f_inode_bad_iaddr/README b/tests/f_inode_bad_iaddr/README new file mode 100644 index 000000000000..5ada3226ab5d --- /dev/null +++ b/tests/f_inode_bad_iaddr/README @@ -0,0 +1,6 @@ +1. create f2fs image +2. mount f2fs and create a regular file and write data +3. get a block address by dumping the inode +4. inject i_addr[0x100] of the inode with an invalid value +5. fsck fixes the inode by nullify i_addr[0x100] +6. check if i_addr[0x100] is 0 diff --git a/tests/f_inode_bad_iaddr/expect.in b/tests/f_inode_bad_iaddr/expect.in new file mode 100644 index 000000000000..a7a80c5dc5f3 --- /dev/null +++ b/tests/f_inode_bad_iaddr/expect.in @@ -0,0 +1,38 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (fsck_chk_data_blk:x) --> blkaddress is not valid. [0x12345] +[FIX] (fsck_chk_inode_blk:x) --> [_INO_] i_addr[256] = NULL_ADDR +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_ has wrong ext: [pgofs:_PGOFS_, blk:_BLK_, len:_LEN_] +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_ has i_blocks: 0x00000202, but has 0x201 blocks +[FIX] (fsck_chk_inode_blk:x) --> [0x4] i_blocks=0x00000202 -> 0x201 + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Fail] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Fail] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_inode_bad_iaddr/script b/tests/f_inode_bad_iaddr/script new file mode 100644 index 000000000000..8d0ba8d169e3 --- /dev/null +++ b/tests/f_inode_bad_iaddr/script @@ -0,0 +1,58 @@ +#!/bin/sh + +DESC="inode with invalid i_addr" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +dd if=/dev/zero of=$TESTDIR/mntdir/testfile bs=4K count=513 status=none +ino=`stat -c "%i" $TESTDIR/mntdir/testfile` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` +ext=`$DUMP $DUMP_OPTS -i $ino $META | grep i_ext:` +pgofs=`echo $ext | sed 's/.*fofs:\([0-9]\+\).*/0x\1/g'` +blk=`echo $ext | sed 's/.*blkaddr:\([0-9]\+\).*/0x\1/g'` +len=`echo $ext | sed 's/.*len:\([0-9]\+\).*/0x\1/g'` +echo "ino:$ino blkaddr:$blkaddr ext:$ext" >> $LOG + +$INJECT --node --nid $ino --mb i_addr --idx $((0x100)) --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + + +INO=`printf "0x%x" $ino` +PGOFS=$(($pgofs)) +BLK=$(($blk)) +LEN=$(($len)) +sed "s/_INO_/$INO/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_PGOFS_/$PGOFS/g" $TESTDIR/expect +sed -i "s/_BLK_/$BLK/g" $TESTDIR/expect +sed -i "s/_LEN_/$LEN/g" $TESTDIR/expect + +$DUMP $DUMP_OPTS -i $ino $META >> $LOG 2>&1 +new_blkaddr=`$DUMP $DUMP_OPTS -i $ino $META | grep "\[0x100\]" | sed 's/i_addr\[0x100\].*: \([0-9]*\)\]$/\1/g'` + +# if i_addr is 0, dump.f2fs hides this i_addr slot +if [ x"$new_blkaddr" != x"" ]; then + echo "old_blkaddr: $blkaddr" >> $OUT + echo "new_blkaddr: $new_blkaddr" >> $OUT +fi + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C135D2AB31 for ; Tue, 29 Oct 2024 12:12:09 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l4z-00081L-Pp; Tue, 29 Oct 2024 12:12:09 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4y-00081A-0e for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4kJmZgvV+zVzsmgBzTrnuxJLsoaJkE96OxtlCg1qrrs=; b=FeIIHr04mOGl+zot3pb4kPebGM XzuHjIVYHCFsx0kfh5rOGG7J4MAkmbr+fyrViEt9F8cQXFh2VEX/2YuPF+hHCF++idp9fh+N4mpxd 99JdZ+RVS3qV+0t4cCrQ+fW4kmFvgBMH9mFYa7XdWfjs9nhzst/8QebgkIQNwQESrhBs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4kJmZgvV+zVzsmgBzTrnuxJLsoaJkE96OxtlCg1qrrs=; b=TPhZP1ZISR1lwERWKkSWXoLanZ PRx7NbbMnUVuIClvy1DSfN9f3j6VMHkzok5BrPeVN8Ve7HfkYQc+FN1NUoBRA23Skdy1yJKsgBaaI C658nC3pOM22A+CZWlExoJ+f9ilxfHm6YDObQ/2/Wde9NvxSx2M8aMD//NKMgRIzgHL8=; Received: from mail-koreacentralazon11013051.outbound.protection.outlook.com ([40.107.44.51] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4w-0007Sn-HX for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=chOqqDamKaYCOZCPfqblfeA1MHjLmcPi5NpSpQZiLCfEJHAkP3aSFnT+Lmf/FQ2e2+FbkSkzxzxq3yUZRUzl0p+esgazBcO3vFDyHS6QFMnRDHdhlzQvd3sjY284OcrY4zS+75/GfWZ3SWufimCqyyfVOaJ1r+znGEWq/umi/7PkY1ksdEC42la+Qq95V7L28ZKzjO3hBkqd9pVtgD/zAW4MgAMUi7xTo+RXqqNqe84fGoOzZk/UyrMJLLbhIxttUvgfY92/0IuRH70Ggdxq0VrIZFjj586KnYCZOnDuCFAHhaott7jHN6lNNV9FFXp9O6/xnkwa7fjzWX4YCDHhww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4kJmZgvV+zVzsmgBzTrnuxJLsoaJkE96OxtlCg1qrrs=; b=dsCLUlhPvNHpYENuVn6aXzTu38ijGrXzIFQOIawnxyq8MY8c7YGleloQ8ZLyyD/ctJB4/KR/E/Uce80rjDi2F3G+n30+lBjZxtvaQsYFg1cK7VzVofF1DH829FkgOwjm/Y53uAb638x1XBB7qoO66qI87lV4MUxqvxzMjb0vb2OCpMInIWLy3cUQuOHEMOA8jFiZHjU8oS2myENAag9yzccUq1Hjc+3wae/xkA8zToK9Mot3KDIXLpzYTqL5fP4NfTM5zyNtkq0keC73OdUw4YYaz7MfYbRpnnjMUtZTGVW7uC9rBG+oea9UNDYs3Src8X9SAMMt4xTfK4k96ObYJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4kJmZgvV+zVzsmgBzTrnuxJLsoaJkE96OxtlCg1qrrs=; b=LpV7YNi4mBXzq4qdViBgzavQ/0Kq7PjOtg9LyIPTRxDyus+RCl8AlIJh6XNl90eMBAEfFp7801eHWcfIeXWL1FqxQr4rBJbHekKTiTj8u9iPeH/ykeMHp1wC7rartsC9hO5PmzoM4/iXPF+Toc8+LakrMfPtIZCQaDOAlfaNnCY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:52 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:52 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:53 +0800 Message-Id: <20241029120956.4186731-22-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: b278bb87-f3f5-4a33-6232-08dcf812dfbb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: wM/q4JfcoUACR3ALsbIrEy2XKeg32jJjyVRr+oG6mgFpkOMnEH0m+B6SpY9g/rccoAir5C4s2hZ9CmfnnnLbfs+aTE7hxXaRWxfxIrmmY6ep26UfHpcC9U4uhQL3UUApZHQvRMEMRsBzhYhgSNO5XWAjOlqjvphFdb7kRUB+lKQdSV3XfTaKiakx/tE9SucazheSYACanf4lqew9lQ0aIyJuebSbLQRwBb0tthtk/WTEIqeyfJiFPG/cufOYx82TSqwCYfoQhTd8dFSt5KaOq6E5eR9ma6Y8Lsj0Dbe7IefSmC8HuzIXWNwvXZ8jhlvLA8kf2AW8aQrxakcw1y7/ynYB211J5AH7Wav6RaAYfB4EZveN9Q28/qQ8paHq11fN6KPntT2y7w19ehT9IXotMcCAsylHOF5tf7UWWfslHzSvmyDqE6/KEs3tBb3JWfIR/8mJ+oF3NEU/Og7Ax+29sRNpZIbBsF8L5huUMtrG15q/ngmge0WtjjsMw337ElrCh66oJL5qn7/cKbUcZaUh/yY+trRUWiXtO6s6nLTS+0g+4uLx5uFatDyXxMKGm5jtnweUZkf01G3mPjnLguf7pR4h9zn+VPfOmx0S+Kx12vIlcwB5UgzXquDfiuAOfJhakapTPSeK9JLaPNoOnI+z01mo3JLjXVAQwhzAI8fvbonQwTzeW2TGjqzKPEJc5+s8plPpt5TLM5/TV2xBo7k/mvjFv+47NNy/k54NOpAf9F+pEttjp3x7ahk7XbAVmY6PNlNy2HVroL78DZ5l0iQDLep1QXlc0Zs8PKAGEaw8vSKrFU3iByrwXS8k53e1/Hcl6OQzgQXeCc6wtY9zgzR/wvLx0okq8odusja7iza30Mpto1DLeBp6Ixh8Hu7GSS33RWujllvJ/AfQFbTya1iaZ2Q4F3RWjgdUOkZeIMdU5g4PZ0/AqakG+7WAMuhOhFDieLB+05DMhejQ1mEesvqY2FUh7KiJyg+B+LIx2sXGP5yPv2DMBZpTTtgjHtgm317blWQMqdWrGO0YcGGkthbyP1ZhX5LL/WbMmVlGFCm9Vm54m7V2TBV/j2D+pqsJzHeAL3j8X+6SATsme4sfI7/9pOJoNan1trt8MjSWt8HHs781mVmdDwRH/z7NlZ6B9h3xw6TSQ1LprD6ZVHUy/I1vEgqA3yDGKzuBR1YNxXX0Og8clDcJVlwcw/edSKI2B+zaQs8On5H8B/bUUwsMTiYsRW2tuTmTrE0QFQt9PzUy57uISRkNiepq3nnpM451SXeGKh14gNUqtigIDZ7tzK2yAvSgL9xPNcU0hGKar7da5fG0Mv2h2KKjkfcJvGBAytmmpZUtpNN97AJ6Ptx4ykcVsM4clhUqUeKWEDIiLHbG4kA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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8jJJNQUtFysknPWx/LXi7P+ZkIrP2mZ/W5uXwWu8DB1P6SsIPpBMyl2Bkjek78q6L2d+DE6rA2SDOQ/DP0EJeT6Y7oldjN82idyxn/lu1OfuU22xgK7LIjuC+65Xjo9mUCc49PJj75kXLo2lzEzMHpzkSe1+poMi9AQKXkJmYm5hyL/PHPtVBq8jl+IV6ohusMzy+9xETPd4GnychW9F3u7MYxrkuj57j2uAQsWtXmyzs7GLk/Sz0HiTuqd/EYJasnaTFz0CqEFxHKVRtfKxql4EvtbpG4aXMto0fyC/hYMMjZ6cervE6pWXj2nXDpz0fcBi0KsrkkvVyCQffO7xMSZ22qdZFWWITNK4v8WBkM6rmtlkflYupwQ5GBgnYz3C/Rh5ZHVWDPyYldxhbUsFdIw67IFTBm56bhVSnGil+J+Cltwuxdu4VOYxTnl1yo9+PRI60bmLyuAHSaX0sUqoFL708nMyrjJMf0DMHttA9pE1WLYpvJ17GYNYUibTTjwNuuizMYE4/DyccvCnyFsSenljLmQnhz X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b278bb87-f3f5-4a33-6232-08dcf812dfbb X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:52.8167 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VfTwG7L6ssVNSyfYml9s+5LF5M6UJGk+g3aXxnnRiIW/apbt5eSlTv5OOw27iK1D40rkKmTTz62TH6n5rBYH5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5l4w-0007Sn-HX Subject: [f2fs-dev] [RFC PATCH 21/24] tests: add fsck testcase of fixing dentry hash code X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_dentry_bad_hash/README | 8 ++++ tests/f_dentry_bad_hash/expect.in | 62 +++++++++++++++++++++++++++ tests/f_dentry_bad_hash/script | 71 +++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 tests/f_dentry_bad_hash/README create mode 100644 tests/f_dentry_bad_hash/expect.in create mode 100644 tests/f_dentry_bad_hash/script diff --git a/tests/f_dentry_bad_hash/README b/tests/f_dentry_bad_hash/README new file mode 100644 index 000000000000..f36c44f7c7bd --- /dev/null +++ b/tests/f_dentry_bad_hash/README @@ -0,0 +1,8 @@ +1. create f2fs image +2. mount f2fs +3. create an inline dentry directory, and create a file in it +4. inject dentry's hash_code of the file +5. fsck fixes the dentry's hash_code +6. create a non-inline dentry directory (by converting), and create a file in it +7. inject dentry's hash_code of the file +8. fsck fixes the dentry's hash_code diff --git a/tests/f_dentry_bad_hash/expect.in b/tests/f_dentry_bad_hash/expect.in new file mode 100644 index 000000000000..f453c411f7b2 --- /dev/null +++ b/tests/f_dentry_bad_hash/expect.in @@ -0,0 +1,62 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[FIX] (f2fs_check_hash_code:x) --> Mismatch hash_code for "testfile1" [12345:_HASH1_] + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[FIX] (f2fs_check_hash_code:x) --> Mismatch hash_code for "testfile2" [12345:_HASH2_] + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_dentry_bad_hash/script b/tests/f_dentry_bad_hash/script new file mode 100644 index 000000000000..011e6c6dc214 --- /dev/null +++ b/tests/f_dentry_bad_hash/script @@ -0,0 +1,71 @@ +#!/bin/sh + +DESC="dentry with invalid hash_code" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +# inject inline dentry +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +mkdir $TESTDIR/mntdir/testdir1 +touch $TESTDIR/mntdir/testdir1/testfile1 +ino=`stat -c "%i" $TESTDIR/mntdir/testdir1/testfile1` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi + +hash_code=`$INJECT --dry-run --dent --nid $ino --mb d_hash $META | grep "Info: inject dentry d_hash of nid" | awk '{print $(NF-2)}'` +echo "ino:$ino hash_code=$hash_code" >> $LOG + +$INJECT --dent --nid $ino --mb d_hash --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG +skip_lines=`wc -l $OUT` + +HASH_CODE=`printf "%x" $hash_code` +sed "s/_HASH1_/$HASH_CODE/g" $TESTDIR/expect.in > $TESTDIR/expect + +# inject non-inline dentry +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +mkdir $TESTDIR/mntdir/testdir2 +i=0 +while [ $i -lt 30 ]; do + touch $TESTDIR/mntdir/testdir2/loooooooooooooooooooooooooognametestfile$i + i=$(($i + 1)) +done +touch $TESTDIR/mntdir/testdir2/testfile2 +ino=`stat -c "%i" $TESTDIR/mntdir/testdir2/testfile2` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +hash_code=`$INJECT --dry-run --dent --nid $ino --mb d_hash $META | grep "Info: inject dentry d_hash of nid" | awk '{print $(NF-2)}'` +echo "ino:$ino hash_code=$hash_code" >> $LOG + +$INJECT --dent --nid $ino --mb d_hash --val 0x12345 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT | tail -n +$skip_lines >> $LOG + +HASH_CODE=`printf "%x" $hash_code` +sed -i "s/_HASH2_/$HASH_CODE/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A23E5D2AB30 for ; Tue, 29 Oct 2024 12:12:10 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l50-0002d9-A0; Tue, 29 Oct 2024 12:12:10 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4y-0002cq-Lg for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MQfwO9bSjijqmphNvKjfaILHF5bB+UDG34IJMEyGfD4=; b=hr+7ebY0P64UQNMFrq0Pc7c5DA suhKsZ6+C2tQjX9dMDKKZB1yOzBi1rHXuF3Lt/zX6f36PWVtIHUxjd+s7J0K6v18uf1v5sh5FN3j7 3lB9JI5SogyBKXM8S6bNfIvLqU+rnYBcIRfMyyf+qOho+kF9Rw951Y6GF3prrC+dS0CA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MQfwO9bSjijqmphNvKjfaILHF5bB+UDG34IJMEyGfD4=; b=P0DxQmw4IzEC9ndsdQlzTNfflP Q3ETfeM+jlijE08mnXNKXazYCMPJv+rpcBybp7Y45pS65jQP8wnZQEnCJt38QTxApW4R/OSYkpo/e 7c29kRg/gIPMuvCgsJ58cVcD1pjAd0WjyaI+jYKLauEWo6X5V3NveTpm6GAldQ+N2GOs=; Received: from mail-koreacentralazon11013051.outbound.protection.outlook.com ([40.107.44.51] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4x-0007Sn-Nx for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B5Kj5dAHyb/7oJooS7W9YVoQJlhjLA+I1ltR9y8pYcfNCFzWyTsMaguwXUXGJ/jWahBWhCiS64vPvDL1wsXMUxOvpbjhS0xFcVSvL47r5e4W/VHtAzA+9Bahev+xtj6YPSdAyAEAFXOIMJ+DOI9ZniD9bHEMqfBJabqZNIdlstaPcPgLP6KyhZ5xatP9EPMdp79nTu7tDG0tC2mC7mbxuYENiki/1RuFEC91tB882xmSR6460dvI88qVGRUBHNJ+S6V2AbQZFdq5Xr635GiERnBGFIS2i3Gkv7BrBJTvk55dy3FUgUA0qWvqa76sQ3WMtyyf4dOtBwUWSwJCh3kABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MQfwO9bSjijqmphNvKjfaILHF5bB+UDG34IJMEyGfD4=; b=mupdDR+3J3vdM0zl4BfGM1MpvNsApaR6dk3/mNA5ZhfVKCdRFwGZvswGF0P89Fq3jLAFtzrOkokbLTBqm3gFuU8LiPVPmnt+EeiyXlr9wmTTE9IjZKkbXd5uefOy+r95Y+G3WCgSuT20+1Hpy2v94n48nSZxH0eXp9hMUkzNUhgDEkLq+NteQ8Y19h9IHtoWKpqeaCwg7MEmRILqMvnrNgf/muAh7XlBaNON4i6XvFtkvmwSizvygNwTgt+Ly5GXGnKCyguls8qT1fQqJA39Vxdk5C1YShNCW4W4vo32QVmPe+3BjgMJ/EetJT5p/TzWmIV+2I6fxPUMzlnf/mWHAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MQfwO9bSjijqmphNvKjfaILHF5bB+UDG34IJMEyGfD4=; b=VyAxOq++GwrKDgQlG0gdM4KsTjg0Lv+DzCRvzCAABr+1GWTVJwptJ4Skg8s6oTiSXXb8dFs3n4/Qc7vjp+ikJWTsGRd3Uk7xhTFfj2Q8y6Kw9hXnuhJNbzaroM9o3217V/Rf5QocAyJe8ZzRnNH1PDgeMdKXC9t18W7ZrKOODuQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:54 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:54 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:54 +0800 Message-Id: <20241029120956.4186731-23-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 86eac41e-41a1-4f24-4dd9-08dcf812e070 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: MnOieXJqw0ZKJz5l12yKa8HrHQ3bM2SmXVNh+cBupPHP1zfk97RYtbETBMOa5J58fVVx6eADxPv5qssBQQtWx4hWYTyTSz11xWmhzFPlPFwkQTGy3Lfs0jxyMEXqyY6fJGY3XP8kLdOK3y7VS8PVDzz+RwhYkFScNplGfr/FR47Ykm3xyFLUlvn+tdz5UcJw1XjDNZ1X+8mWPwrOsQMM07MuLSxmIEAEapYs2XgPN9144VDTp1EUHNAf++X/MiHIKi3KZKT0QKw9ELd3Oe8BH+/IlSlSXn4EPWpVPd4Gbsd4RTZUL6ykefhla464swvbbqezDkcExG2b/GcnJfmdnCnEImVQf2VDbHbkb3eF5y+uISSqD5UFi3mHsvzAtqv+Msv9VesdKNR+BXUt/dofDcn2c6xWx1LXJD6/5ahBOPRjSltRJToceum9tt1IKlZG0WRLho1ZpJBFtgptuUp3n2J2/xAb2dIK2Q5wujq0qEfDvfXDxdgUYNriBpyklc1P5OfXJnNPgUeo+UbopgdKHauJ7uJxkP6uRNI22bYpyZOzbsWeiHIYR+gasmB+8QIQ/ajGaFrk6AiPm6xJ6zGJ9z6aL2WbTOJn2QnQnw/tIS1RKi+PzWBdPeC02GpKySg7PEQWXoKRQ334hWSIdITeoMHFXc2IMf7/hEkgDEXMKQ4KKIqxNxfmdbzv7MzqHOi/3tGvgMQATaFGT7DZn1bmkeFPvaSpK5PcWACxUW52uv2HPopzZHAwZ2ldGZ4d/1pUiPYGFWN8aEnBlMlvnulzW4iXeJlZf68/aT2JLwva2VlrzUmFldG3gpWHjUdSYNZEIXccMVw3W2jmENKFdI3Cc8foIeRh2z2bN5Yj7f/5g8d134CiJvNXnQXjp/mNOpKgtUzpC5bP+P/1NbLXgI25/xe3Ic0Z9EJBtNAl7TyjoS315afkOZfm7lP1bOddUjOv60c3ZiTw6lykmcZnNbHDs8v82l5L05JqFXSbUE+zXtP7gb8dTIoQq1hOXWaR0kGu+6d2cOWfE1tlGYN9qnc0jV699Q9Q3EGi7RS4QZMt3VxeOCQgAtHYNidNRq/+rCaNEtSaURPeRWQus0kYrNpe9PEkujk6s+dBkyrIbOiDcD0JUpWtniJyb4BrS1z2Se9rfvlAeuqneDD2Ii7GKJ9EFi5jbpdCIGSrRnLkuWc911ZqKm14fy8MvEoHFrk9yB99ItBAPmu2kUctr9rcd9/4PZpRPQvcGkw5amezI96lU+WmXhawdzZMUd0qoJ6StybkaUB6obGzqn1/Q7UGuGy6vcxMAPDfgz1LONT0tWI9HbdWHGIgzPAxGw5gqZtKIdVnb4HM4pr6w39aY/IQWyrL48YBjwXi6MZ/4tzSKybWG4k= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tZSESRb3vR+yjGCAeaflxLCLnCi3f5ZvUJ9j7YSNFDl1e14jXj/Bg7Go+VOv02Vm0cPgctrcFw1AEZanRKx8yeqNKX4LpadI7BzdyQYBilMxeILpMP658Oh5xaUlRiYvPON3BMLEtidsmxuN5LiT05yCmJvAEJTmBCs4bvtrEdnLT+cp3xwiRKb/RsE8Lf9Mq3OkfyIkyqNw0e/bxGhau9KayDuKk2pR1VLZGXh0xspLrbATfFA3AgkzX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8ok6rMYbBUBodn8Gh3B6SYu6JQ12YuC1dyRoMTuJaFJfCshTMRegrUXQZK29OkmSbXk1hOOJH/6H9DWqq/ps1YFXUTKXtD7AVxR37iWkwi2lfjYOe1tDMKU8xVMJCd8m9yCQPSXbFKCJU9rbiMH4t+7ud1aqt+vzEokngi0XoqR6vXp8xlZpXbLpLZrez0diJ1VK74rSSSbJaZZIi/ufx4Xx4+HCxuORhEH4FGbAPBgFKdXA1XyfQpPGjegO3y53vHDCBX4w9c88y X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86eac41e-41a1-4f24-4dd9-08dcf812e070 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:54.0053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tDY5xAwK6Yub5nTiB4T209pnYjiL2HA3D64TzGRy514/nnEEcAsHIXe8n6TJxUEdfiZW3Sb6HNTKwvZ4Gl2yPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5l4x-0007Sn-Nx Subject: [f2fs-dev] [RFC PATCH 22/24] tests: add fsck testcase of fixing lost dots X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_dentry_lost_dots/README | 7 +++ tests/f_dentry_lost_dots/expect.in | 74 ++++++++++++++++++++++++++++++ tests/f_dentry_lost_dots/script | 46 +++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 tests/f_dentry_lost_dots/README create mode 100644 tests/f_dentry_lost_dots/expect.in create mode 100644 tests/f_dentry_lost_dots/script diff --git a/tests/f_dentry_lost_dots/README b/tests/f_dentry_lost_dots/README new file mode 100644 index 000000000000..f07a1165b8cc --- /dev/null +++ b/tests/f_dentry_lost_dots/README @@ -0,0 +1,7 @@ +1. create f2fs image +2. mount f2fs +3. create a directory, and create a file in it +4. inject dot dentry in the directory by invalidating its valid bit +5. fsck fixes by adding a new dot dentry +6. inject dotdot dentry in the directory by invalidating its valid bit +7. fsck fixes by adding a new dotdot dentry diff --git a/tests/f_dentry_lost_dots/expect.in b/tests/f_dentry_lost_dots/expect.in new file mode 100644 index 000000000000..1d0f9572fcbd --- /dev/null +++ b/tests/f_dentry_lost_dots/expect.in @@ -0,0 +1,74 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_HEX_ has no '.' and/or '..' dirents, dot: 0, dotdot: 1 +[FIX] (fsck_chk_inode_blk:x) --> convert inline dentry ino: _INO_DEC_, pino: _PINO_DEC_, ret: 0 +[FIX] (fsck_chk_inode_blk:x) --> add missing '.' dirent in ino: _INO_DEC_, pino: _PINO_DEC_, ret:0 + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_HEX_ has no '.' and/or '..' dirents, dot: 1, dotdot: 0 +[FIX] (fsck_chk_inode_blk:x) --> convert inline dentry ino: _INO_DEC_, pino: _PINO_DEC_, ret: 0 +[FIX] (fsck_chk_inode_blk:x) --> add missing '..' dirent in ino: _INO_DEC_, pino: _PINO_DEC_, ret:0 + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_dentry_lost_dots/script b/tests/f_dentry_lost_dots/script new file mode 100644 index 000000000000..711304785546 --- /dev/null +++ b/tests/f_dentry_lost_dots/script @@ -0,0 +1,46 @@ +#!/bin/bash + +DESC="directory missing dot or dotdot" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +mkdir $TESTDIR/mntdir/testdir +touch $TESTDIR/mntdir/testdir/testfile +ino=`stat -c "%i" $TESTDIR/mntdir/testdir` +pino=`stat -c "%i" $TESTDIR/mntdir/testdir/..` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +echo "ino:$ino pino:$pino" >> $LOG + +# inject dot +$INJECT --dent --nid $ino --mb d_bitmap --dots 1 --val 0 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 + +# inject dotdot +$INJECT --dent --nid $ino --mb d_bitmap --dots 2 --val 0 $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +INO_HEX=`printf "0x%x" $ino` +sed "s/_INO_HEX_/$INO_HEX/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_INO_DEC_/$ino/g" $TESTDIR/expect +sed -i "s/_PINO_DEC_/$pino/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854828 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47B0AD2AB2F for ; Tue, 29 Oct 2024 12:12:12 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l51-00042l-6z; Tue, 29 Oct 2024 12:12:11 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l4z-00042X-77 for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jRN/11OnMc/ec8MSOvFtJFnpQXpJht9mSu/10DP2tCo=; b=fiqF6ex5o5B8vY6tCUToAi6Tp6 e0zVWVKBFDp5k5pVOfkEmRwH8nJEJBPN3JWOnETo3K1i3MdtoBlN5dir+PmCcFIlSwq539TChf9I9 17jre+3+dGsxcGlJRIs85PmIhpyAIFG4qTJA17h0AqXOV7f40f+pYjijuiBwYtDlhClw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jRN/11OnMc/ec8MSOvFtJFnpQXpJht9mSu/10DP2tCo=; b=GoX3N9vmUlvEvAsPAWznl0yq5Y o68HVfqbPjac+x/hKH8qiypvkV90NyIHaGb881xwH8JyCRQyiNpdABAgOxnJ61/wZ6eu8EzrPDEEb Cy4TPdWqZbTpimhAV9FMTzAYuMlii9ilGWFi0DPwvuwZrMhiUcu3W4Nkhr0ATk5/PTIU=; Received: from mail-koreacentralazon11013051.outbound.protection.outlook.com ([40.107.44.51] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l4y-0007Sn-TK for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kitATZSgmBkvdynwHc0sinpP420V2cwpDT8u5UqgU1ayiy083m6LfcgcxMwHfbjdJ2gTVKMs16HrcKCFXPzk33mp6iOCYYtOPFV3b3p6EOH1165zIX5TZjHN2BkiAQg9GjrsQQtkKTVCo8qruH07HAFcOHo3RazF4hEY3Dus15+b64pxW8zFn8Pii7Ezar8TrXBmN2xm9KTfyYnif7zppqu5ZJoM4my+AArJK9WaYm4TVGyTsLyrz63Zeoz3l7kCvLPEd5RFeSa9hWMRtIs3oIjZTLfGJCx42XJAuHPINNPKDgR23FQr0GKS49RP8D+umyr1hZCPZRcXaxQUGxq+yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jRN/11OnMc/ec8MSOvFtJFnpQXpJht9mSu/10DP2tCo=; b=Sxo8r/+OscDX9E0zSrzGSoNIBoZzmwGd0rB1wVGv+afg+86icBdy1s5bqYCoVk9c28Bw+scqd72ZSD1AoWhpDVNawizsDuqTntrC7D6mKBHw+yels7BuHAezucrsYndeW0JtGKwEMJ1T1FyvzlmmAEpNnJu1l0m7JWD0W6t3mRUxuYI3/3FQDvJ0dJwvtWnGOMOQiArKrbxSD1SpkOOjU7yfi7q0iI37euTztPQx0X5Kz/4oIpCaVddsQaoSatEAnzzD1ZnSWX3Fem4B0cYim9giIGyzOxoZFzR7S1z44tzO6+yRyu8KDndTTPWwCczOAB1ZiR2NHowaOrKq8PR3TQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jRN/11OnMc/ec8MSOvFtJFnpQXpJht9mSu/10DP2tCo=; b=VGAquNg+jHPiP3mXxFCgSDfsd+Mo8b6mrjj212cSF1wuFe/6iNwHRcrcD5Wr2ioKX/W5vm0RlEFTNYdt6scnhuloADmtFiff449xbVMD4JGGwEnYFrg7HKUktxGkfiZBQcWZhPYOlVBYhozvKznyPVwkkZ8kCqy+0sszaiGSc/Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:55 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:55 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:55 +0800 Message-Id: <20241029120956.4186731-24-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 0363338d-d31e-4985-24ed-08dcf812e127 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: tFovH/Zv6c4n7uyd20BbXrcoT8Zhp0Famt+KGmoW+d/PfANdbnBJSPBraIhwstU7eNGBSgcC7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aYCnkpNh7i7Qu8BKQipc/Yj0igjjQTS1cuX4ncvSWfkRpsv+BZjbhdDvyFdBAyAz1/kydz8X9jUiQl50xfmt+6fcg1NdQkp+YuYKv5AaaXSNkI6Y4kRg1hNLO79Dw0zj5zZBErtLVL6U7R6sJ9kRJHw909dDRndmFyYfffZwN3QImEgT9rOz0/LXR82cngymcY8tyXPHaVuoxSh1jFLngX6vBrVYQNDjFF9ws= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B5lche5W4csYfKbIfaBN68EO6La2Q13e0AU77MyJb8wCAymXI8NR4WyBDRgDorNALUDSFeb+DCDiIrFTMIrXK2avKcvPyAc46oDGkg7XYXkdczWkIPLXC0D3jqYG6F+IQlTNGtEB3kq7NEEc7F4rW5EXVGtymZOE7diOWHJVqJlx8YmB4zYpaLqX3zOWPTiB0jHlwileQuXvE7oBTc6VSyWEtXBsGeQ6jG5hRQBwD6bVbFA274/1kzIDYDR7zlgKhffrZL0HnzGOA4XV0qFFy6dXGInqR0+Gwuv9/Va0NHJ0V/V7TSeARux/t/QoWkb+W99Q9wEhN1+/JJvc2WFb7KHrwO80KvjymOOvbWMmWF68X84+B84OYeQXH2o2gvBUdm3vbp0J0tz9QtnCLCreya4w75XleQrjnzgx8923CHKXkuU5So4Nrog2R+hJBGgLOX2EF2w9f3sFOXbfEFgShCB6N0rOCpubabpxqiISBmCWWjks1I4nZB202zvMCiDJUIEQjfQs8Ysi+WQ4QAAlY+JaT0qVMp4DteeC0CwWbS3ijKm62NZuB4DEVVU+63Dx/b5j1+HDJdczUdXqChwApdecPeKnQVjb/g0k5JWvmBzi9NeYsnseav+JzPpYFxHvwK1DZJ7z/J7MHNAVFuFGQMlad8ISnLqJwaiZ6gtjb0W3DPWpmWwMyhxg7l9WzfvCM/Ij9iBFLZljAJgNKsi8jBDR8Qy3ZP8AGv6AGWY8jIaxXhRaXklBtnmNXeyqT5639Pm+eeb4FSlEg8xWLxAb9srlNim3TCDvu6Snod7vzoXckhIGwzuR3Vu9vYWzb0s7N8FoLZYWO1zTSxl9wnwe6ZwS6WbUSCVJQVX962ueWgD6Y8TUZoSvxRlp8VsMZ0XL7T9AI5DcRZtFVILQdaRujARsPDKQt1KtirNJAgCIZmt06FUOLJEBKv+Qv8/3Ak6FnPRG4afI/VosWjZYCDP0qOAs6RPN5BzR//TyB66t/6W51tJUlptFhAjZBhq+bINrGTyVus4WROcJ7CfGrWJVm5TCl+30MQKWpL2MjQoskqLwyN0iU7GqlXnBmnCQaY6K6U/9WqGPzGy976T84oy7rGtIcxRjUhW+Dc3MFJ2P86fqRSsz696bmhGMfXh3VJvaMPTMQZk/sD61L6+5cSK3oZHSunlZfx26Vi955YytWt6WhHV74aBy6HlZVUiawGl0RDw/2g6J7wt3N0A9ykms8WtWH6/D8Z021hEE9wumrPDvXd+4F3tHJ1jThpTm5S6O3snCSHphCq7L9dKO6ntvGIvxr7GpKRTUw9NL0Yx0BH5hcmhTWY2HN56tOAsZOZmk419QchTDt63pNTf/zSwkDvmODog3Bpk8+Wj4PZD7mJLYoGiZ6e3qRH0THcR/41JvUeMsxQ+12MWJXt0itcAVXM834SQWsa7fCuJKD9YR/C442viK0e2tih/2WE4ii/KoLKLrnO8zPaOqr9IeFKJ5LLWZbrxOb9uVBBHAJ8sykIWmyJgDPjsKAF/jmSOoyyp4ZWS3dUb/+tFPI5hcUfIw8cOVYapicqEsOfBXurlzZgZapFgnVt4k4819IynmxZ4G X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0363338d-d31e-4985-24ed-08dcf812e127 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:55.1996 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hxrcTbSoNyMW1iyiZM0hW/CHJ1y5/Fa1CsGyIJgBbxKJ/dvT9j+V4KFv58/ckQJ7Q8GKVAlzp+tr0qmLi1g0zQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5l4y-0007Sn-TK Subject: [f2fs-dev] [RFC PATCH 23/24] tests: add fsck testcase of fixing duplicated dots X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_dentry_dup_dots/README | 11 +++ tests/f_dentry_dup_dots/expect.in | 150 ++++++++++++++++++++++++++++++ tests/f_dentry_dup_dots/script | 58 ++++++++++++ 3 files changed, 219 insertions(+) create mode 100644 tests/f_dentry_dup_dots/README create mode 100644 tests/f_dentry_dup_dots/expect.in create mode 100644 tests/f_dentry_dup_dots/script diff --git a/tests/f_dentry_dup_dots/README b/tests/f_dentry_dup_dots/README new file mode 100644 index 000000000000..54304051d548 --- /dev/null +++ b/tests/f_dentry_dup_dots/README @@ -0,0 +1,11 @@ +1. create f2fs image +2. mount f2fs +3. create a directory, and create a file in it +4. inject dot dentry in the directory by changing its d_ino to the dotdot's ino +5. fsck fixes the dot's d_ino +6. inject dotdot dentry in the directory by changing its d_ino to the dot's ino +7. fsck fixes the dotdot's d_ino +8. inject dot dentry in the directory by changing its filename to ".." +9. fsck fixes it by deleting duplicated dotdot dentry and adding a new dot dentry +10. inject dotdot dentry in the directory by changing its filename to the "." +11. fsck fixes it by deleting duplicated dot dentry and adding a new dotdot dentry diff --git a/tests/f_dentry_dup_dots/expect.in b/tests/f_dentry_dup_dots/expect.in new file mode 100644 index 000000000000..ce2a45c09080 --- /dev/null +++ b/tests/f_dentry_dup_dots/expect.in @@ -0,0 +1,150 @@ +Info: Force to fix corruption +Info: checkpoint state = x : nat_bits crc compacted_summary unmount +[ASSERT] (__chk_dots_dentries:x) --> Bad inode number[_PINO_HEX_] for '.', parent_ino is [_INO_HEX_] + + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount +[ASSERT] (__chk_dots_dentries:x) --> Bad inode number[_INO_HEX_] for '..', parent parent ino is [_PINO_HEX_] + + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount +[ASSERT] (__chk_dots_dentries:x) --> Bad inode number[_INO_HEX_] for '..', parent parent ino is [_PINO_HEX_] + +[ASSERT] (__chk_dentries:x) --> More than one '..', should delete the extra one, i: 1, ino:_PINO_DEC_ +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_HEX_ has no '.' and/or '..' dirents, dot: 0, dotdot: 1 +[FIX] (fsck_chk_inode_blk:x) --> convert inline dentry ino: _INO_DEC_, pino: _PINO_DEC_, ret: 0 +[FIX] (fsck_chk_inode_blk:x) --> add missing '.' dirent in ino: _INO_DEC_, pino: _PINO_DEC_, ret:0 + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount +[ASSERT] (__chk_dots_dentries:x) --> Bad inode number[_PINO_HEX_] for '.', parent_ino is [_INO_HEX_] + +[ASSERT] (__chk_dentries:x) --> More than one '.', should delete the extra one, i: 1, ino:_INO_DEC_ +[ASSERT] (fsck_chk_inode_blk:x) --> ino: _INO_HEX_ has no '.' and/or '..' dirents, dot: 1, dotdot: 0 +[FIX] (fsck_chk_inode_blk:x) --> convert inline dentry ino: _INO_DEC_, pino: _PINO_DEC_, ret: 0 +[FIX] (fsck_chk_inode_blk:x) --> add missing '..' dirent in ino: _INO_DEC_, pino: _PINO_DEC_, ret:0 + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits unmount + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_dentry_dup_dots/script b/tests/f_dentry_dup_dots/script new file mode 100644 index 000000000000..6f6a92cb2843 --- /dev/null +++ b/tests/f_dentry_dup_dots/script @@ -0,0 +1,58 @@ +#!/bin/bash + +DESC="directory duplicated dot or dotdot" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 +make_f2fs >> $LOG 2>&1 + +mkdir $TESTDIR/mntdir +safe_mount $MNT_OPTS $META $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot mount f2fs image" + exit +fi +mkdir $TESTDIR/mntdir/testdir +touch $TESTDIR/mntdir/testdir/testfile +ino=`stat -c "%i" $TESTDIR/mntdir/testdir` +pino=`stat -c "%i" $TESTDIR/mntdir/testdir/..` +safe_umount $TESTDIR/mntdir >> $LOG 2>&1 +if [ $? -ne 0 ]; then + echo "cannot umount f2fs image" + exit +fi +rm -rf $TESTDIR/mntdir + +echo "ino:$ino pino:$pino" >> $LOG + +# inject dot's d_ino +$INJECT --dent --nid $ino --mb d_ino --dots 1 --val $pino $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 + +# inject dotdot's d_ino +$INJECT --dent --nid $ino --mb d_ino --dots 2 --val $ino $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 + +# inject dot's filename +$INJECT --dent --nid $ino --mb filename --dots 1 --str ".." $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 + +# inject dotdot's filename +$INJECT --dent --nid $ino --mb filename --dots 2 --str "." $META >> $LOG 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +INO_HEX=`printf "0x%x" $ino` +PINO_HEX=`printf "0x%x" $pino` +sed "s/_INO_DEC_/$ino/g" $TESTDIR/expect.in > $TESTDIR/expect +sed -i "s/_PINO_DEC_/$pino/g" $TESTDIR/expect +sed -i "s/_INO_HEX_/$INO_HEX/g" $TESTDIR/expect +sed -i "s/_PINO_HEX_/$PINO_HEX/g" $TESTDIR/expect + +check_result +cleanup post >> $LOG 2>&1 From patchwork Tue Oct 29 12:09:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13854829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4373AD2AB30 for ; Tue, 29 Oct 2024 12:12:15 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t5l54-00044k-TZ; Tue, 29 Oct 2024 12:12:14 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5l53-00044N-Qp for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mjkCV3Ra+l0qYLj4JLSUG7YBWRHNs95IifUoKflIWOw=; b=nWHOuaP3nA5PfIuyUhZ4xUb2Ix 25K4aRsrH05GoW+2xcXi0D5Z586NvLnraiVsStXoxj8pzNL2U13lEi4ee5Qql5gBbXNDrXKCoAA9w 1kE5o2ciRkNslMdi1iMZUNRufw1/2u+Q8C0JTN4Pz0CJKUuARYHYsKvKBfFlCFCEFTbE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mjkCV3Ra+l0qYLj4JLSUG7YBWRHNs95IifUoKflIWOw=; b=SKLAZCoqu3I3dqphBsADdFcQr6 tCQ97739nYndxK+BIhVWekbeM67cwm4g/B2tMhW6PT4xSim4gej2SUYJJf6cECmBSC6t876sEiTfV hFpV/U+fC9Z6K38c09CUPrODYFrFUbD0pQqTZUzDpa4s3Vx6fNwdxhNXVyiE7/Hyvfvk=; Received: from mail-koreacentralazon11013051.outbound.protection.outlook.com ([40.107.44.51] helo=SEYPR02CU001.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t5l50-0007Sn-8R for linux-f2fs-devel@lists.sourceforge.net; Tue, 29 Oct 2024 12:12:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CJX9Yjv+zyJUF8/QG3ocouApFIzv7lMIYskLzrtYT/BtX6p3Cx01SYdwq91EIbzBBJSX4P7JlWODG0Ur0gx+SoMqBnStAmkvUFyTgf0ulmsREsETNVZVealBFkfCK8+VN1c2mzYRnVq+ct2sm4sSqb7tVPf8un9pv4sNaE/2/rY8iz5IPUEweIOTCTocz//u/iQbEeMONkSulvOrP1/kmzbYXTzWAhKA7XDuLvRuHvh+GLIZS7ga4ksKQ57ol21wn5ENb7iMltLxRCJ8x+CO6RfmeiGWyqu9lH9xLtxcdNZYh3d68obXQCPjfoHTP75CIdpFwDoiYeSxeeq7gNSBgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mjkCV3Ra+l0qYLj4JLSUG7YBWRHNs95IifUoKflIWOw=; b=LXrfUDtCDOxa+ZnmMicUr/M0JOZXP94YFApeM5wen1fHx1k2r2qXfKs8yo1dKiq8sumDA7G8HhzUv+X7MibpsOyD9T4P1mV697BgIuX+5En5wdTipIUe+aXwjeUbLIxOu0Y8Tg8pnB8W0chGRRNdiDp5fv6hbl5VNZ7UAGmojYFlkgSkFxL5P6JxiUFNnTsW3Rdz6r+FRAGCG9dMyB/5HJ29vj+P42m4F6twHZsQaeMAdr0CmSNjhoSgrMZ2oGEJno0pUHqiURtV+yCMUyhrUsFWhqQvGDoAbj+0FC8sB3aFh47AQC8Kao+/TdiLEvttjLF3mtPu70JgePaxZRTOqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mjkCV3Ra+l0qYLj4JLSUG7YBWRHNs95IifUoKflIWOw=; b=apmJYLEslMll7yAlnTEgI1GkwtlA1IzaYBGyTDr9DmUgkdphRKnP/UgfJw6rUp0qjiWTOzFSyquYcrCHWIaH2XdVf+O7jth50/BZUmJaGox7/8cjATmKrDy+sLwg5zUQxW0V0BlitjLTn6wwQiDW0UfEnhbMz57wOu6VQTaSsWY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TY0PR02MB6982.apcprd02.prod.outlook.com (2603:1096:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Tue, 29 Oct 2024 12:11:56 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8093.023; Tue, 29 Oct 2024 12:11:56 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 29 Oct 2024 20:09:56 +0800 Message-Id: <20241029120956.4186731-25-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241029120956.4186731-1-shengyong@oppo.com> References: <20241029120956.4186731-1-shengyong@oppo.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TY0PR02MB6982:EE_ X-MS-Office365-Filtering-Correlation-Id: 8629016b-d582-4065-2cfc-08dcf812e1dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: C+C39dUzposgteov/UCzYd7aXi4qkE1KWzjf61aiW3syoy3LnZWI2kWnZXsjc2+EFRLqHl7ExeeHEcTe3Oy6kJPJzxQDXMYuEKOlbWEAVI/7JvNihHGMV8rwnNWUAQEMfCdRq0dbXHAGPFz0nP1bwyHzKFJnaFKN0IkVJlyOS0ypz2PbsEMvwlgA4TfLwd66UOd3wRlNw0SSkkj35+wT1ObdYFb2UF3pwItG7bASqCSIawv34+Z75QuhrDOhKnLI5sKJbYWyzotrJ4fYWNLDyb903U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1BD/uY2PDHay6YItsAsBpfKXdGw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: t5MEyStuM9AY8B9JIM1o6K7YDUahXf8tqzqF48Akp+wTP6qB9i26nBFsaeV0aeFwTDUfnRlxDjDbW2eR1K1pl8Xl+n/EqZV+sWVGWt4rF8zaGYg8Pb7nVLkx7t6THaYgUY7j/nnkouaO1VOChiZfdLv4liOYv54Q++ZxW3h+YwF/cUU07iuKCxuj1mmY+/V5yNcs2EPKjYTbTYNRGnkbtl1RoeOdV+GcjzmaJTliypS7JUYwddZZN3lfVvTQ1BUxrsMbYNuKxoz5AKNq11CPLtJ50IMyHajMn0fxNa47fSlrx+vrzylSbFvfwf/L479HHPz7jS/oVthG3i2YRloRC5x0k9tFwqgtUKhiHt2I0PsxZszvBVpU8c1TauerSYfjG6Hn0pzJ6waEc6sGs+lqNBflSj7faJ6CY0ABl3Q1VjPdhuW0fpYJg3NyPxilFR0OIbmLATQzq+SD4kkLbG7bS3v1cJGAtr0VrzEK7WXWUvpkJ0PwYULgmbLU4MhwR5iVOeMDekq9n5MmiVlrRa9nY7+lP4CO7zpxcad5Fk5VQbp7IdBd3bHpfAUlARpgTalOEM5Nk0GYlixY1SogiYVUwJq3XmN1uAJjX87s0Dbv0ZdUx8+/Gf2M4aq+Ykc9sCLWBhejXdhwoaslt2stysOLruD+rMD1Qlr+1SWjTX8llyrq+rNNFizjohnoXABuvrNX2hcx9WSwZDGhbHIdpPwBHf4guaG0oyqnO2hJn9z5gURZWMEsZ8ogfVrgT12tHoPdCTi6YGlsBbZQOFlv7Qc2ski2tMsriRfLqrETs5vw0KWusy1kUNNVVX1mhPEc0AhML+tWkZVA5Z3+STsqcScPNgKlL0gzVG8/iMsY3oOfz7RUmdbGT3+/V/RavJ3h5U0VQSM+6HzWh8r4nsyChoPlrD+A03fwd38MSqSBrok7MBjKNrgrJSrXdoDAA2cEtr8Qc/lTpV6wVfd7xsZinzsCuQQIfjOOvG7He25zqzAt5a11oP3DnzywhpVkGj0Meaj3TSC85dzx3SwQX/bLoMr0knFfKJsbtRTBiD1KCLY2fMvAW8h7OFqs7FkkpMI008HwYgztHUaf91dzFcnDiu9sfgxMYs0PDJElGZbUAjCw7ttY3HxqQ9WFjY9DlrxShsoAC2UQ9kqFufg8sbJGonO+xi38xsnRJFFEkhnhRWLqp3bmpXNkIWLe7QAMsnseu6dgXZkzOPNDiHDETPxCm3cTaqWGEEPQOqowMU00vOFowkqzCtlP1+xwmd3KDXD0v1pcvFLHqznHV6oL3onNt6l2qua5h/qVUgt/ZTU2q0ZFIZfN3DMM0rKpbGLhs8i3dcjFYT9mWNCXoDRGspBhCBLJpoPQCs8O7m1heqQj4YH9nXKYNaUU7VE4b0rQ7ineQxqwPWSLY1ywcrfr+u+0g8IwEVDdnsQ882QI1ZyvchgYNRMifL0Nv4T3uBKsL9kT3nBE/EuxLgEAdr+bh+rcXAoJnJD/EgFXmeGg37lIp1TK0tiIUbksnU6AgVPFSIxtAIpXa2EvkBLrvy+6cbWqtS0cjvgLfJaACphEHERpsbxQeowGDTDOfMOaH7sVAQN2/5wm X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8629016b-d582-4065-2cfc-08dcf812e1dd X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 12:11:56.4879 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rz02QyiTZnMXGEczMfAOuk58y0OwbYTxkLXf5f9Skn0zz4ZrARQUi/wPZ5D6YPd3h5FtCMHpo00nC+ry9EX2cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB6982 X-Headers-End: 1t5l50-0007Sn-8R Subject: [f2fs-dev] [RFC PATCH 24/24] tests: add fsck testcase of fixing loop fsync dnodes X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Sheng Yong --- tests/f_loop_fsync_dnodes/README | 39 +++++++++++++++++++++++++ tests/f_loop_fsync_dnodes/expect.in | 40 ++++++++++++++++++++++++++ tests/f_loop_fsync_dnodes/imgs.tar.gz | Bin 0 -> 173228 bytes tests/f_loop_fsync_dnodes/script | 16 +++++++++++ 4 files changed, 95 insertions(+) create mode 100644 tests/f_loop_fsync_dnodes/README create mode 100644 tests/f_loop_fsync_dnodes/expect.in create mode 100644 tests/f_loop_fsync_dnodes/imgs.tar.gz create mode 100644 tests/f_loop_fsync_dnodes/script diff --git a/tests/f_loop_fsync_dnodes/README b/tests/f_loop_fsync_dnodes/README new file mode 100644 index 000000000000..77dcba497f2d --- /dev/null +++ b/tests/f_loop_fsync_dnodes/README @@ -0,0 +1,39 @@ +1. prepare f2fs image with fsync dnodes: + + mkfs.f2fs $MKFS_OPTS $META + mkdir mntdir + mount $META mntdir -o mode=lfs + touch mntdir/testfile + f2fs_io checkpoint mntdir/testfile + fio -rw=write -bs=4k -direct=0 -size=4k -numjobs=10 -name=testfile -fsync_on_close=1 -group_reporting -stats=0 --output=/dev/null -directory=mntdir + f2fs_io shutdown 2 mntdir/testfile + umount mntdir + +2. inject fsync dnodes to generate a loop + + inject.f2fs --dry-run --cp 0 --mb next_blkaddr --idx 1 --val 0 $META + [inject_cp: 592] [ 0] blkaddr:0x1201 + [inject_cp: 592] [ 1] blkaddr:0x1202 + [inject_cp: 592] [ 2] blkaddr:0x1203 + [inject_cp: 592] [ 3] blkaddr:0x1204 + [inject_cp: 592] [ 4] blkaddr:0x1205 + [inject_cp: 592] [ 5] blkaddr:0x1206 + [inject_cp: 592] [ 6] blkaddr:0x1207 + [inject_cp: 592] [ 7] blkaddr:0x1208 + [inject_cp: 592] [ 8] blkaddr:0x1209 + [inject_cp: 592] [ 9] blkaddr:0x120a + inject.f2fs --cp 0 --mb next_blkaddr --idx 6 --val 0x1202 $META + [inject_cp: 592] [ 0] blkaddr:0x1201 + [inject_cp: 592] [ 1] blkaddr:0x1202 + [inject_cp: 592] [ 2] blkaddr:0x1203 + [inject_cp: 592] [ 3] blkaddr:0x1204 + [inject_cp: 592] [ 4] blkaddr:0x1205 + [inject_cp: 592] [ 5] blkaddr:0x1206 + [inject_cp: 592] [ 6] blkaddr:0x1207 + [inject_cp: 592] [ 7] blkaddr:0x1208 + [inject_cp: 592] [ 8] blkaddr:0x1209 + [inject_cp: 592] [ 9] blkaddr:0x120a + Info: inject next_blkaddr[6] of cp 2: 0x1207 -> 0x1202 + tar cf - meta.img | gzip -9 - > imgs.tar.gz + +3. fsck fixes fsync dnodes by breaking the loop diff --git a/tests/f_loop_fsync_dnodes/expect.in b/tests/f_loop_fsync_dnodes/expect.in new file mode 100644 index 000000000000..3f0790224663 --- /dev/null +++ b/tests/f_loop_fsync_dnodes/expect.in @@ -0,0 +1,40 @@ +Info: Force to fix corruption +[ASSERT] (sanity_check_node_chain:x) --> detect looped node chain, blkaddr:4615 + +[FIX] (loop_node_chain_fix:x) --> Fix looped node chain on blkaddr 4615 + +Info: Write valid nat_bits in checkpoint +Info: checkpoint state = x : nat_bits crc compacted_summary sudden-power-off + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Fail] +Info: Duplicate valid checkpoint to mirror position x -> x +Info: Write valid nat_bits in checkpoint +Info: write_checkpoint() cur_cp:x +Info: Write valid nat_bits in checkpoint +Info: fix_checkpoint() cur_cp:x + +Info: Force to fix corruption +Info: checkpoint state = x : allow_nocrc nat_bits sudden-power-off + +[FSCK] Unreachable nat entries [Ok..] [x] +[FSCK] SIT valid block bitmap checking [Ok..] +[FSCK] Hard link checking for regular file [Ok..] [x] +[FSCK] valid_block_count matching with CP [Ok..] [x] +[FSCK] valid_node_count matching with CP (de lookup) [Ok..] [x] +[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [x] +[FSCK] valid_inode_count matched with CP [Ok..] [x] +[FSCK] free segment_count matched with CP [Ok..] [x] +[FSCK] next block offset is free [Ok..] +[FSCK] fixing SIT types +[FSCK] other corrupted bugs [Ok..] + diff --git a/tests/f_loop_fsync_dnodes/imgs.tar.gz b/tests/f_loop_fsync_dnodes/imgs.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8a4e5d75b002377f23ef5f69f6928396e24afcb7 GIT binary patch literal 173228 zcmeF(S5#9?94PwF&w_%0ih^_z1*s8{Ce1>VDqXtt4$>i{sHjMn-V^E4dnZJC@4bea zP(mjO5RzQKbMD)DIxlzKa~As{S!>qJ?EU{`GV4FPafV(0=fCaW%h>roHwMG||12ec zRmymIL23MM13v&0<@1=FVQU&d#br(a>br_)gr&wp^o?D*<5 zUgPW^6~%>&(fZ`n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K2Ty;0bC%TID~V z1_S^CKmZ5;0U!VbfB+Bx0zd!=00AHX1b_e#00KY&2mk>f00e*l5C8%|00;m9AOHl6 z@Nm)pbpgIz8B$6B4j=#ofB+Bx0zd!=00AHX1b_e#00KY&2mk>f00e*l5C8%|00;m9 zAOHk_01yBIK;Sf00fAU3$Omy1?WaqK2`@FKmZ5;0U!VbfB+Bx z0zd!=00AHX1b_e#00KY&2mk>f00e*l5C8%|00;m9AOHk_z<*v~(i`pWzcRoR)P%Ik ze?AQe00e*l5C8%|00;m9AOHk_01yBIKmZ5;0U!VbfB+Bx0zd!=00AHX1b_e#00KY& z2pHkvqW|jxe7iEFlmHw+00;m9AOHk_01yBIKmZ5;0U!VbfB+Bx0zd!=00AHX1b_e# z00KY&2mk>f00e-*e_p^>^df00e*l5C8%| z00;m9AOHk_01yBIKmZ5;0U!VbfB+Bx0zd!=5F-~}{jUqqjjDXC4m^MW5C8%|00;m9 zAOHk_01yBIKmZ5;0U!VbfB+Bx0zd!=00AHX1b_e#00KY&2mpcqyuhS4+TDL;fG4O4 zX_fzc8V~>o00AHX1b_e#00KY&2mk>f00e*l5C8%|00;m9AOHk_01yBIKmZ5;0U!Vb zfB+CM!ox-X*9G`?Wk@LjIDh~U00KY&2mk>f00e*l5C8%|00;m9AOHk_01yBIKmZ5; z0U!VbfB+Bx0zd!=0D=F!K$hrBhJRfE{9{z50M5TpU;zOj@K2zGfbBKb$eky5F#iwf C*7Aw~ literal 0 HcmV?d00001 diff --git a/tests/f_loop_fsync_dnodes/script b/tests/f_loop_fsync_dnodes/script new file mode 100644 index 000000000000..adce57c686c6 --- /dev/null +++ b/tests/f_loop_fsync_dnodes/script @@ -0,0 +1,16 @@ +#!/bin/bash + +DESC="recover loop fsync dnodes" + +. $TOPDIR/tests/helpers + +cleanup pre > $LOG 2>&1 + +tar xf $TESTDIR/imgs.tar.gz -C $TESTDIR/../ + +$FSCK $FSCK_OPTS -f $META > $OUT 2>&1 +$FSCK $FSCK_OPTS -f $META >> $OUT 2>&1 +cat $OUT >> $LOG + +check_result +cleanup post >> $LOG 2>&1