From patchwork Mon Nov 20 09:54:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13460995 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 BCE44C197A0 for ; Mon, 20 Nov 2023 09:45:10 +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 1r50q6-0002ai-3s; Mon, 20 Nov 2023 09:45:09 +0000 Received: from [172.30.20.202] (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 1r50q5-0002aa-05 for linux-f2fs-devel@lists.sourceforge.net; Mon, 20 Nov 2023 09:45: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 :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=NAzQ59DRbN9IBPvfTnj3BYj+z1yok15X8nyQgFac1BI=; b=LKaVgzWXQaknoC8E5DZijfGThy YWEL/Xy42uWCcCpe4O+v6XOkPyM5b8YQmfnMt3XNJDfcGKx3+5iv2Yesycxim8z0ipC3EB9v5tP0P cWCnwnxCWJ5FGgA7IROCEPV4HpYbpaRyNvWzBEf06sP/zsAcLiIpvxdX+jaCmz7N2IPw=; 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=NAzQ59DRbN9IBPvfTnj3BYj+z1yok15X8nyQgFac1BI=; b=k wlvKyTc++IlqrB8ZLk4gbsaB5wBdpU81lKGUhHf5jw17qYVK983E7PtTogYcuhf+5j6I8lwMD7K7A 9NwLbL4oQFS6nOAGU3/4i5ZpgEOqK/C2NyXbLDpl7R/JKl8O8GuD58CZYsh9mmHQT/lM11zxLk9ZG vpBNuKbzWmWSCfFg=; Received: from mail-psaapc01on2115.outbound.protection.outlook.com ([40.107.255.115] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1r50pz-00At5A-Nf for linux-f2fs-devel@lists.sourceforge.net; Mon, 20 Nov 2023 09:45:07 +0000 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 To: Jaegeuk Kim , Chao Yu 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 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/LZTNLr78JD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DM6OOYZ4molE1KBM8r15yRgC02dUNfYOa2lC37rHSU5S7yl66weXhhOBJgnTg8FAanBP3ESk//kQ+yZhdtIXKjE1RLBcg5eOywczpqPvqHlFzQbPHixCCuIhAC/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-Headers-End: 1r50pz-00At5A-Nf Subject: [f2fs-dev] [PATCH] f2fs: add support for an i_version counter 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: Yangtao Li via Linux-f2fs-devel From: Yangtao Li Reply-To: Yangtao Li Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 --- 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 #include +#include 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))