Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9310b224 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFS: Fix incorrect size revalidation when holding a delegation



We should only care about checking the attributes if the page cache
is marked as dubious (using NFS_INO_REVAL_PAGECACHE) and the
NFS_INO_REVAL_FORCED flag is set.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 10727772
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -102,8 +102,11 @@ static int nfs_revalidate_file_size(struct inode *inode, struct file *filp)
{
{
	struct nfs_server *server = NFS_SERVER(inode);
	struct nfs_server *server = NFS_SERVER(inode);
	struct nfs_inode *nfsi = NFS_I(inode);
	struct nfs_inode *nfsi = NFS_I(inode);
	const unsigned long force_reval = NFS_INO_REVAL_PAGECACHE|NFS_INO_REVAL_FORCED;
	unsigned long cache_validity = nfsi->cache_validity;


	if (nfs_have_delegated_attributes(inode))
	if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ) &&
	    (cache_validity & force_reval) != force_reval)
		goto out_noreval;
		goto out_noreval;


	if (filp->f_flags & O_DIRECT)
	if (filp->f_flags & O_DIRECT)