• Jeff Layton's avatar
    nfsd: use the getattr operation to fetch i_version · 638e3e7d
    Jeff Layton authored
    Now that we can call into vfs_getattr to get the i_version field, use
    that facility to fetch it instead of doing it in nfsd4_change_attribute.
    
    Neil also pointed out recently that IS_I_VERSION directory operations
    are always logged, and so we only need to mitigate the rollback problem
    on regular files. Also, we don't need to factor in the ctime when
    reexporting NFS or Ceph.
    
    Set the STATX_CHANGE_COOKIE (and BTIME) bits in the request when we're
    dealing with a v4 request. Then, instead of looking at IS_I_VERSION when
    generating the change attr, look at the result mask and only use it if
    STATX_CHANGE_COOKIE is set.
    
    Change nfsd4_change_attribute to only factor in the ctime if it's a
    regular file and the fs doesn't advertise STATX_ATTR_CHANGE_MONOTONIC.
    Acked-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Reviewed-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    638e3e7d
nfsfh.c 20.8 KB