mbox series

[RFC,0/4] vfs: allow querying i_version via statx

Message ID 20220805183543.274352-1-jlayton@kernel.org
Headers show
Series vfs: allow querying i_version via statx | expand

Message

Jeff Layton Aug. 5, 2022, 6:35 p.m. UTC
Recently I posted a patch to turn on the i_version counter
unconditionally in ext4, and Lukas rightly pointed out that we don't
currently have an easy way to validate its functionality. You can fetch
it via NFS (and see it in network traces), but there's no way to get to
it from userland.

Besides testing, this may also be of use for userland NFS servers, or by
any program that wants to accurately check for file changes, and not be
subject to mtime granularity problems.

Comments and suggestions welcome. I'm not 100% convinced that this is a
great idea, but we've had people ask for it before and it seems like a
reasonable thing to provide.

Jeff Layton (4):
  vfs: report change attribute in statx for IS_I_VERSION inodes
  nfs: report the change attribute if requested
  afs: fill out change attribute in statx replies
  ceph: fill in the change attribute in statx requests

 fs/afs/inode.c            |  2 ++
 fs/ceph/inode.c           | 14 +++++++++-----
 fs/nfs/inode.c            |  3 +++
 fs/stat.c                 |  7 +++++++
 include/linux/stat.h      |  1 +
 include/uapi/linux/stat.h |  3 ++-
 samples/vfs/test-statx.c  |  4 +++-
 7 files changed, 27 insertions(+), 7 deletions(-)

Comments

Frank Filz Aug. 5, 2022, 6:52 p.m. UTC | #1
> Recently I posted a patch to turn on the i_version counter unconditionally
in
> ext4, and Lukas rightly pointed out that we don't currently have an easy
way to
> validate its functionality. You can fetch it via NFS (and see it in
network traces),
> but there's no way to get to it from userland.
> 
> Besides testing, this may also be of use for userland NFS servers, or by
any
> program that wants to accurately check for file changes, and not be
subject to
> mtime granularity problems.

This would definitely be useful for NFS Ganesha.

Thanks

Frank

> Comments and suggestions welcome. I'm not 100% convinced that this is a
> great idea, but we've had people ask for it before and it seems like a
reasonable
> thing to provide.
> 
> Jeff Layton (4):
>   vfs: report change attribute in statx for IS_I_VERSION inodes
>   nfs: report the change attribute if requested
>   afs: fill out change attribute in statx replies
>   ceph: fill in the change attribute in statx requests
> 
>  fs/afs/inode.c            |  2 ++
>  fs/ceph/inode.c           | 14 +++++++++-----
>  fs/nfs/inode.c            |  3 +++
>  fs/stat.c                 |  7 +++++++
>  include/linux/stat.h      |  1 +
>  include/uapi/linux/stat.h |  3 ++-
>  samples/vfs/test-statx.c  |  4 +++-
>  7 files changed, 27 insertions(+), 7 deletions(-)
> 
> --
> 2.37.1