linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Yangtao Li <frank.li@vivo.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: add support for an i_version counter
Date: Tue, 28 Nov 2023 10:42:31 +0800	[thread overview]
Message-ID: <bcacb482-5496-0a86-2e6a-a58d310cb0dc@kernel.org> (raw)
In-Reply-To: <20231120095410.3604801-1-frank.li@vivo.com>

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))


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2023-11-28  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20  9:54 [f2fs-dev] [PATCH] f2fs: add support for an i_version counter Yangtao Li via Linux-f2fs-devel
2023-11-28  2:42 ` Chao Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcacb482-5496-0a86-2e6a-a58d310cb0dc@kernel.org \
    --to=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).