From patchwork Fri Jan 26 06:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangxirui X-Patchwork-Id: 13532139 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 B4A7DC47422 for ; Fri, 26 Jan 2024 06:42:00 +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 1rTFuY-0003AE-Dj; Fri, 26 Jan 2024 06:41:58 +0000 Received: from [172.30.20.202] (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 1rTFuV-0003A4-W6 for linux-f2fs-devel@lists.sourceforge.net; Fri, 26 Jan 2024 06:41: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 :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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=klYo/5e+mzk3nE8dRXmvmN8vjjZ/ZJXVlBfXoRT/AtM=; b=eQqdLKAZ7xxdwGH2wtshgD7r76 MmA+znxCwJ9elMJSjGL+TLUp2/vynK1KnpxLR3dEAUu04HrAvBoItXQEvcNIygV2ru8Z/6Yg1sRAK X6/yqJt2RJ1p/by1WJT4K8c/CF2k1vquU/EvKyRDmeLXZn6SLj4IDdaM+Tc6bG/ktJQs=; 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: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=klYo/5e+mzk3nE8dRXmvmN8vjjZ/ZJXVlBfXoRT/AtM=; b=j 1liZBrVBumtN0M2pP3a1DIHQ6ClPkw1xehgvOqyE+B124LXnVju+5PkpfeGSSUooDdm3LnB77vt1Q tokA961g329q6WDnYSCQCDAHTw2KMxY261FTdjWp5QAqGQZeTX5C+HRBZF3/qKi2uX02FaRbA45Jq JK1aZU+o2WtHUSWc=; Received: from mail-sgaapc01on2098.outbound.protection.outlook.com ([40.107.215.98] helo=APC01-SG2-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 1rTFuP-0003bY-Fr for linux-f2fs-devel@lists.sourceforge.net; Fri, 26 Jan 2024 06:41:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IeWlPNyQGZrLP4DbqHPj3BRi2xLsLJFyvBM0SBrKGO7xE2sY4tDdveeSSNDb4V3PnC2B1634o3JkFeiWo2feSsQ7JXzitxhpeFVHfmYDs3w8Ujok93ZNwrL+Rwaik7tB4Rj0zogxgiZhMQhmuzA3KUbbO5jRMJBAJqjAa8/LNHLwZRWkBfFvwh4shpLurPLg+HvCXlYSiKG25uFXn4ep/UHRRslrWvuv9ZUkSn6YAE3cE3EJ1a+MKet5lPubSp4qXARMiY6n707B39VwXRy4ci+59mzVFsOFyJRcribVeFXT5WS4/u9Uz64EJCK+rmVs16do7HjbZ/ojNITVvtZD2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=klYo/5e+mzk3nE8dRXmvmN8vjjZ/ZJXVlBfXoRT/AtM=; b=G694IYxsqcysDNTHUlhDQ7jyvJjQYEgOdjtZaKnMk2AKo3c1p/PNZdnDP7HTzyanOAMnqnOT2izormBEcyI0btCspAArtyoeGh2V01skK3C3tge1Gh6jOGfK4FOZ9ahBFvOPsLnV5M6RT3XzSqNgaQ26su0Z2w9zTCI160cEmJukS9VSVlx2kG7t5lY2z+DBxBZgi8cbEakxqrHJschXu0ijJrMed4JccW9isocC5J1Xxoe1+9l/JA2v1f4AMER+kHxYLC+Gukki1q7Kr5XtP2K2ZTkgUr/NOSutWzp8wLHmJkpSPN4mESAW/YmHB4QTzi7KdYaDIAmzKpj0vVCmoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=klYo/5e+mzk3nE8dRXmvmN8vjjZ/ZJXVlBfXoRT/AtM=; b=EPMgW8MgoP4aNwbVbVBa+EJ5mkzJxI+arvXOB9qw4NX4lvvQq/E1Mspj2CDxVIq89moyxFsP/lvwLvODfZmLFEKr7PoJFta0jbuub7dm+knK8LebDM/TtIngwqP20AUVtMncAadZj6TOGuEPAFrw0oUGZ83PurvEE3aKqiFFsw464xluHbYLc2ea1Fb4dvJEU1b2GXDNIjY28P36T8rUrNJWK8Zi5jamSC6a1PUHqN1ALllwhU0lAaCE2PRKBfYPlYuqfviFetpYKUJl7us2Rhne+YLQWW1iKBiDktkqCAnXh6Roz8hX/lIKtHk2lxgqjcysWdJrUB6ZeAMy22P4BA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) by PUZPR06MB5572.apcprd06.prod.outlook.com (2603:1096:301:e9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 06:26:31 +0000 Received: from TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::c24e:98ad:6b31:b435]) by TYZPR06MB5178.apcprd06.prod.outlook.com ([fe80::c24e:98ad:6b31:b435%4]) with mapi id 15.20.7228.027; Fri, 26 Jan 2024 06:26:31 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Thu, 25 Jan 2024 23:37:23 -0700 Message-Id: <20240126063723.2926123-1-xirui.zhang@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2P153CA0028.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::15) To TYZPR06MB5178.apcprd06.prod.outlook.com (2603:1096:400:1f7::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5178:EE_|PUZPR06MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 362b7845-3cae-4a16-8a61-08dc1e37bc41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FRE5CkVA6ZxxS+25SRf5dXE/Gy/KPvoBfrRu87ZlTrHTU+cGayrK0xX7FfZsXc6RLt+ENlM1wRv1hmb8ELFdglswQ0mK0Nqy6+sxQQz3swiuBB4aAovOQ+nY3juL4cpxTii3ig0ChWqpE1ZmnCQToiV6Ksi3L0BrSUEySlg5kONFjiJevEZnc6p0AFk8Fe1MKUVZXD8TyfYkwK7OkGC6Ik11jX4lphfWmhkPnRXRghppg+CBst7qlMyrTXwdPbe9slCTHVXiissY4BPkY9O0XgHSHoAJcS2xXrmZ8WpsfdpaAuXBdqqm1WU5+ui+sAIU7oqNAcLZIDjzvsFgAocuHWDiheZjMGRbRLlm7iAi81qTnKhDL+sm5CGkd3ihUEL+FB8XlQxHNi9eyDegl4TPqiy13Xoy2AYoSL26ctsx+CIms94nFafyUDb+mRPdn9s3hIDW+T81yB6aiQyJ5BljVOWoqdYXuTGPjuUhhaDJsRxCx8+tobBt9PkovDxHf4/NhAPoolf6/8tsRU876S10+LI/n/171sPKcbFSf4FcZ52pwPh2ugu7I17ZOnSsNelFmD/BiY0oCJctcNm1BL6nxv9acHt26LyM+CberonU8jgTTqBhA5+DDeu1dc5A5kd5TsKOpcd/0ytLgGLmWPT9wQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB5178.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(38350700005)(5660300002)(83380400001)(8676002)(6512007)(66946007)(52116002)(66476007)(6506007)(6486002)(66556008)(107886003)(6666004)(1076003)(2616005)(316002)(8936002)(478600001)(26005)(4326008)(38100700002)(4744005)(86362001)(41300700001)(2906002)(36756003)(43062008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yCHYo47z3mGpteUWIMYlpkHi9GCxJRCKnosW9MaZJm99XOvn/TXHJcG4liMl32iF1/8D4GrMs8fOkL024uDYMD64aJEst7x7B5r1JIGot9GQ0Y6vXa+NnBOyCgVZ0YTXaXk5b61+K4dBWd9GZI9P2ijIBi2HnE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xnUmXUIO7b3AdG5m7CjMZeFC8gzCpsFUUlZMrtaR/L6EPTdaUl5jdYoGgGudqODmlI9xHd3+OTqxd0na155gtaEmLrtovCETNVgHhDJWXrWHDPyZ9QhXJjz7w8aZjePA1nulKrSKHE0hWX6PyR9vNz1Y3Ao4DD41Hb5VX6mxaD7DHMMxpwfzlm4mXFGerKrtkf4RYV9J4kYrGPnYmlxyIuH60DyyB5uN5rmQ/YrymBP6564tr26hMaqncf0q/6et+icr1gduCPuNn/YZATGf/aOcb3dMAGVuItZbGRMJLEcOSZKwj9zlmPJyNmO6s8QVbsM5U9BQ+LzDaQFcJnAvBdst1em+C7vbahyV34CUjk3 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 362b7845-3cae-4a16-8a61-08dc1e37bc41 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5178.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 06:26:31.2554 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ld/AFD6I3Wb3wEnpD6vekkCSbx28M1gmMjp8XiREY9PnRx3tQBMFcfJZeu63kkGWPEd09BZ3h+9xapTI+D5hnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5572 X-Headers-End: 1rTFuP-0003bY-Fr Subject: [f2fs-dev] [PATCH] f2fs-tools: skip check device mount state in sparse mode 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: zhangxirui via Linux-f2fs-devel From: zhangxirui Reply-To: zhangxirui Cc: zhangxirui , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net In sparse mode we just read or write to a sparse file not a block device so no need to check device mount state in sparse mode. Signed-off-by: zhangxirui --- lib/libf2fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 2451201..5315de2 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -830,6 +830,10 @@ int f2fs_devs_are_umounted(void) { int i; + /*no need to check device mount state in sparse mode*/ + if (c.sparse_mode) + return 0; + for (i = 0; i < c.ndevs; i++) if (f2fs_dev_is_umounted((char *)c.devices[i].path)) return -1;