2020-11-17 03:26:39

by J. Bruce Fields

[permalink] [raw]
Subject: [PATCH 4/4] nfs: support i_version in the NFSv4 case

From: "J. Bruce Fields" <[email protected]>

Currently when knfsd re-exports an NFS filesystem, it uses the ctime as
the change attribute. But obviously we have a real change
attribute--the one that was returned from the original server. We
should just use that.

Signed-off-by: J. Bruce Fields <[email protected]>
---
fs/nfs/super.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 4034102010f0..ca85f81d1b9e 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1045,6 +1045,7 @@ static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx)
} else {
sb->s_time_min = S64_MIN;
sb->s_time_max = S64_MAX;
+ sb->s_flags |= SB_I_VERSION;
}

sb->s_magic = NFS_SUPER_MAGIC;
--
2.28.0


2020-11-17 12:36:11

by Jeffrey Layton

[permalink] [raw]
Subject: Re: [PATCH 4/4] nfs: support i_version in the NFSv4 case

On Mon, 2020-11-16 at 22:18 -0500, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <[email protected]>
>
> Currently when knfsd re-exports an NFS filesystem, it uses the ctime as
> the change attribute. But obviously we have a real change
> attribute--the one that was returned from the original server. We
> should just use that.
>
> Signed-off-by: J. Bruce Fields <[email protected]>
> ---
>  fs/nfs/super.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 4034102010f0..ca85f81d1b9e 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -1045,6 +1045,7 @@ static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx)
>   } else {
>   sb->s_time_min = S64_MIN;
>   sb->s_time_max = S64_MAX;
> + sb->s_flags |= SB_I_VERSION;
>   }
>  
>
>   sb->s_magic = NFS_SUPER_MAGIC;

I don't think we want this change. This will make file_update_time
attempt to bump the i_version field itself using the routines in
iversion.h. This will almost certainly do the wrong thing.

--
Jeff Layton <[email protected]>