Commit b4d2314bb88b07e5a04e6c75b442a1dfcd60e340

Authored by Trond Myklebust
1 parent 49697ee792

NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode()

If the NFS_INO_REVAL_FORCED flag is set, that means that we don't yet have
an up to date attribute cache. Even if we hold a delegation, we must
put a GETATTR on the wire.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org

Showing 3 changed files with 8 additions and 2 deletions Side-by-side Diff

... ... @@ -71,5 +71,11 @@
71 71 }
72 72 #endif
73 73  
  74 +static inline int nfs_have_delegated_attributes(struct inode *inode)
  75 +{
  76 + return nfs_have_delegation(inode, FMODE_READ) &&
  77 + !(NFS_I(inode)->cache_validity & NFS_INO_REVAL_FORCED);
  78 +}
  79 +
74 80 #endif
... ... @@ -1789,7 +1789,7 @@
1789 1789 cache = nfs_access_search_rbtree(inode, cred);
1790 1790 if (cache == NULL)
1791 1791 goto out;
1792   - if (!nfs_have_delegation(inode, FMODE_READ) &&
  1792 + if (!nfs_have_delegated_attributes(inode) &&
1793 1793 !time_in_range_open(jiffies, cache->jiffies, cache->jiffies + nfsi->attrtimeo))
1794 1794 goto out_stale;
1795 1795 res->jiffies = cache->jiffies;
... ... @@ -729,7 +729,7 @@
729 729 {
730 730 struct nfs_inode *nfsi = NFS_I(inode);
731 731  
732   - if (nfs_have_delegation(inode, FMODE_READ))
  732 + if (nfs_have_delegated_attributes(inode))
733 733 return 0;
734 734 return !time_in_range_open(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
735 735 }