Message ID | 20231120095410.3604801-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2086176vqn; Mon, 20 Nov 2023 01:46:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH255QSs3gP1boZH4eEFXlH0JLgd1ZGUUHJBHJW0u5umzDG6hpbzvA9dLncPjtjpDrasmRX X-Received: by 2002:a17:902:a413:b0:1cc:5db8:7e92 with SMTP id p19-20020a170902a41300b001cc5db87e92mr5517858plq.58.1700473564146; Mon, 20 Nov 2023 01:46:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700473564; cv=pass; d=google.com; s=arc-20160816; b=whOEmjQJ99X1NCQ+ycbnBLa8IY5ghUDCpjHc0gMBzlPVSK1Ey4T4P2tfd90WX+/Xim +9mdi5HCnICrpHbylGSYCWm492JV45APIh0iyOY4Si6vP6IMe+EIiin7aERF6E/BrSC0 K++pV8sumBSeuPspz1qcoRy+A+uAfCBl47JmwyrAQvLIn+PYg1QiaowIgZSlLCR3x/gz E1urFhRkcPQOOik0PUXE6UcyOEQIVevMqIYtb+hWVrq0U4AgX4eVvPDJGzRExSmEREjY ROQHuHltvQqAEFdPVrHycuDSzbtpRvCtzAlWfBymvYei8/RQxt2O+O3Q2hRu4oPOcEiW niLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=NAzQ59DRbN9IBPvfTnj3BYj+z1yok15X8nyQgFac1BI=; fh=VNAMAEaYEFQ0TTFYWcnMZkT4/7JxlyRr09/ygjVrGqI=; b=c+WBfiX5eAZM0UyvuKm30PQUCVJk86NMoD51dSDXhTj9vBb39gF7erdHZyPtSC8ZbP KZdquxJ6a5zhAhUbKqtdds61Nss1scG2hTOBjDo/ljNuHr4nJH2ztw2qkjVd/DB/esL4 7ToWt54IaghebWAx9diANGWdx2/OmjP6pZk7AUTCRxDQQmwQgnjXb86jQVTE9XhkU0yQ skKnJH3HFkxPbFuroTFK5vAiE7/or3H5NLEmLoC9w+ZDjxiE+FOJB1LXG+P47C3KoPA3 t1+zYa6WwnCu0uymgooIngHNydO/zIiGonUIOfrIbyPfH8qbHg65OABMwLhNjgtryRFr r2yg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ECrCVaoF; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i16-20020a170902c95000b001cf5c99f2adsi2333164pla.261.2023.11.20.01.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 01:46:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ECrCVaoF; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 825658080009; Mon, 20 Nov 2023 01:45:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbjKTJpF (ORCPT <rfc822;heyuhang3455@gmail.com> + 27 others); Mon, 20 Nov 2023 04:45:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231997AbjKTJpD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Nov 2023 04:45:03 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2121.outbound.protection.outlook.com [40.107.255.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 851E1A7 for <linux-kernel@vger.kernel.org>; Mon, 20 Nov 2023 01:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdXzLxZUJww+/x2DqPDC8zaDB7TUl6Byj4Yps3D7iHgOIOC6bY1cZJCQnlFPuyWucN3FpAjU6foj098wmquUZM3j9oHTap4MHONDFfGxYAwBWTzRcZhEPvAU26BmwNPBNfw1SslO/iKIRfogYdBqCC462iQKBEq2nPL8RlWmILuqWOLpOeq77F9RRFipYmZM9e0DHcPyGgq6jmIt+HLVQ6grgfNYP/8w+vDuaWpk3CLfzI0IgF3k3TcBdBnlP77mhv/dRQiY5JMKeOTRQvCGIhEnVOPoNdjAFhr2WaOIfsNnalF7nQeSFZQOqtFg7Uow6s/clQXcNeQpmJ7dUryEuw== 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=NAzQ59DRbN9IBPvfTnj3BYj+z1yok15X8nyQgFac1BI=; b=NUKv8lFFolAZqLmF+R1+8nIu5WRhDf8Tv0Hfkhgv9IDX15knkNSfR0D5fdt8+Cwz8GxNRxQSQnSCgN6O/CkY09qjEQ/9jI0YYuqgN2vrJtX1yHOVugFcMygGHSeQyWjXnMsvpVXdsQN9DEbwt4H9yyByHCh86kIYmYYxvt9PyL3HGuyGQsaCcvIYCPuIbmuILbJfbhA62eTrtf48eeWieAMJU4jZdYaL9rsc01fmGh1vXnh0vbdx4eI2dv50sQcSRrn2wzMWS2yADBiD9mPz2SLU14vxQh9UBP371Q83bKtFpDkgLBfGMP/23VaFQJJr/m43h/BZV0VArMAmiHcq0Q== 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=NAzQ59DRbN9IBPvfTnj3BYj+z1yok15X8nyQgFac1BI=; b=ECrCVaoFEgZHjTRvjZfPABa66WM/wKy7iVaTchbuIvyGyAWbIxx/ucNC3wqFEPWvtp0TW3xSBFSvIM4tqfkXJOO5TV7rO1oixgRSrxABUdoPq4cur9wkHWJXPXt/5APyuZs5Uojt6m0V7xc6HgTT2+Rvx2Hu1ooKW0JaUChmweiGlmqzAErHKKSL4Ln/EinRWkCWveZhJs4ipdcUQMztGr6d3fezGsXBPqBqLt+oDNYRCXZMJUpAAPCIfNnyCsoOLxaWPFAIQHJyhuYRTTZk/RWems0oihlLTPn420sAG4o/Vdn5iLDoGC3/p8mTQS1PhXndLWaqG5+FVwlqSJht6A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYSPR06MB6410.apcprd06.prod.outlook.com (2603:1096:400:42b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.26; Mon, 20 Nov 2023 09:44:54 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8064:576b:554f:5246]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::8064:576b:554f:5246%3]) with mapi id 15.20.7002.026; Mon, 20 Nov 2023 09:44:54 +0000 From: Yangtao Li <frank.li@vivo.com> To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: add support for an i_version counter Date: Mon, 20 Nov 2023 02:54:09 -0700 Message-Id: <20231120095410.3604801-1-frank.li@vivo.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0021.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::33) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYSPR06MB6410:EE_ X-MS-Office365-Filtering-Correlation-Id: 76e1b56f-a890-4f88-4166-08dbe9ad5920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vLgiG7B1vUx0VD2daJGUY4AzfwuKmr8whuCqeqUavrB2PeB7ICEDLCTvuQB2kOatlTcu8mhUT6nadvrvuFSSsFtCxDIGbMZWOftKyXqiBmtfhUYaxhpvG55rHkCIfhSqkbXSybhFKVKkWMm9JiECdmpYTqbaViYbZHWw4KIm2SnzK1ibPm2Tv/9HNa6L4cS7TKsuDptHnUx0H+IbPRroKilFHMIj3uQRbgq+czzuFwOz8r2NxHuEi4Vh/WfHkt0WgTukHOLQ8jcAIsaFIXrlPuJtQMnX9ki9XWT8Nip649GUYO+fYnjdX3LJIkJ/erdj0MZqL9/PacAfKccPV0Tqawu2h4rKjOyLVd+XQ8MWN7IxhW6uNMPPpO61kMQTXiVOXEWYIBCNPOxx9dQ6ejfhzkr6Cv5NS2GZs+QLUUxYQFHmMWL9cQqX5U651DhVrZmy38tHjlcv0F8keaOKIoufsxIwFWCpWBxOYjibojjUP/SfGJqPCc2mA9SKaMdQlYJZG9P0opNiv7CsqaayT3nYcKJvskyRG8VGuNgrQHDbvoWLA3N1VdoJygzuEub/ngp4nhkxJCgjVWwSzkK/fKzTo/fkHLFpvA6HSBEhuyaiJgk4T61lDyi3CwWcVEs0lh3C X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(396003)(366004)(376002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6486002)(6506007)(52116002)(1076003)(6666004)(2616005)(478600001)(6512007)(26005)(110136005)(66556008)(66946007)(66476007)(316002)(86362001)(2906002)(41300700001)(5660300002)(38350700005)(38100700002)(36756003)(8676002)(8936002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dFv9YuhtgS1/Qm/t9wO5yim+GmerjkEWC1plUNaV2qUfYIkpEbuTNeiGd8tGCyfmEMJDTM5b8rnbw57T/FPzWiAdSAMkmCqExrzRWtkjQ1CsN8/zn4yuEk65eFjovjKBCRNClb0Qqo3JxQJvEnB0f7Eb4G1uwxzf8M+UdHHa6zhys57eECKKappQog0egFzim8oJ8e+Z7RdUygNb/LZTNLr78JDsgFUz46SEqNKvU3bB/iu7aFf7KdMHhprPJuPLq2zlWcsE49J7lHnoQst+3W+MYe0+DbCuY3Y4PV2OVUYNv2AM/lnrSOWYYxjW90ylVAandlIB1Ear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CuIhAC/puoDxDbmkLyZkv+Q1hPXgZt1fyDf4EZs2DOVyqkhmOJieDn6wJctOWND8L/jdB23tNfe/rgc3YxNEUEQh5zZEJG5LBYZ/XzcBkTCnjMqU36Dqdp7EJOmMNWSc2fjkkaps/QHarSnWG49t+mbs0m6zz996sn7f7WXyUrYrtBWmpyV9Jb2hhGB X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76e1b56f-a890-4f88-4166-08dbe9ad5920 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2023 09:44:53.9229 (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: u3qMGlm+61nQZIqhHmhUa83Ri1QGodXFMfUDdrqnkcNuvzL5LfGmVX1gVn6zJFG54qXFyavY0qKAoZm6yug70Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6410 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 01:45:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783075767958889343 X-GMAIL-MSGID: 1783075767958889343 |
Series |
f2fs: add support for an i_version counter
|
|
Commit Message
李扬韬
Nov. 20, 2023, 9:54 a.m. UTC
NFSv4 mandates a change attribute to avoid problems with timestamp
granularity, which Linux implements using the i_version counter. This is
particularly important when the underlying filesystem is fast.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/f2fs.h | 1 +
fs/f2fs/inode.c | 1 +
fs/f2fs/super.c | 1 +
3 files changed, 3 insertions(+)
Comments
On 2023/11/20 17:54, Yangtao Li wrote: > NFSv4 mandates a change attribute to avoid problems with timestamp > granularity, which Linux implements using the i_version counter. This is > particularly important when the underlying filesystem is fast. > > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > fs/f2fs/f2fs.h | 1 + > fs/f2fs/inode.c | 1 + > fs/f2fs/super.c | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 9043cedfa12b..68fd2ef35104 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -28,6 +28,7 @@ > > #include <linux/fscrypt.h> > #include <linux/fsverity.h> > +#include <linux/iversion.h> > > struct pagevec; > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > index 560bfcad1af2..2604fa4a0704 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -32,6 +32,7 @@ void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync) > if (f2fs_inode_dirtied(inode, sync)) > return; > > + inode_inc_iversion(inode); For the case f2fs is not used by nfs as backend storage, there will be overhead for iversion update logic. So what about introducing a new mount option to enable the iversion functionality, and disabling it by default? Thanks, > mark_inode_dirty_sync(inode); > } > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 033af907c3b1..2bddccd47e3a 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -2204,6 +2204,7 @@ static void default_options(struct f2fs_sb_info *sbi, bool remount) > set_opt(sbi, MERGE_CHECKPOINT); > F2FS_OPTION(sbi).unusable_cap = 0; > sbi->sb->s_flags |= SB_LAZYTIME; > + sbi->sb->s_flags |= SB_I_VERSION; > if (!f2fs_is_readonly(sbi)) > set_opt(sbi, FLUSH_MERGE); > if (f2fs_sb_has_blkzoned(sbi))
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9043cedfa12b..68fd2ef35104 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -28,6 +28,7 @@ #include <linux/fscrypt.h> #include <linux/fsverity.h> +#include <linux/iversion.h> struct pagevec; diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 560bfcad1af2..2604fa4a0704 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -32,6 +32,7 @@ void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync) if (f2fs_inode_dirtied(inode, sync)) return; + inode_inc_iversion(inode); mark_inode_dirty_sync(inode); } diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 033af907c3b1..2bddccd47e3a 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2204,6 +2204,7 @@ static void default_options(struct f2fs_sb_info *sbi, bool remount) set_opt(sbi, MERGE_CHECKPOINT); F2FS_OPTION(sbi).unusable_cap = 0; sbi->sb->s_flags |= SB_LAZYTIME; + sbi->sb->s_flags |= SB_I_VERSION; if (!f2fs_is_readonly(sbi)) set_opt(sbi, FLUSH_MERGE); if (f2fs_sb_has_blkzoned(sbi))