]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.33.2/nfsv4-don-t-ignore-the-nfs_ino_reval_forced-flag-in-nfs_revalidate_inode.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.33.2 / nfsv4-don-t-ignore-the-nfs_ino_reval_forced-flag-in-nfs_revalidate_inode.patch
CommitLineData
ed95e27c
GKH
1From b4d2314bb88b07e5a04e6c75b442a1dfcd60e340 Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <Trond.Myklebust@netapp.com>
3Date: Wed, 10 Mar 2010 15:21:44 -0500
4Subject: NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode()
5
6From: Trond Myklebust <Trond.Myklebust@netapp.com>
7
8commit b4d2314bb88b07e5a04e6c75b442a1dfcd60e340 upstream.
9
10If the NFS_INO_REVAL_FORCED flag is set, that means that we don't yet have
11an up to date attribute cache. Even if we hold a delegation, we must
12put a GETATTR on the wire.
13
14Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
15Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17---
18 fs/nfs/delegation.h | 6 ++++++
19 fs/nfs/dir.c | 2 +-
20 fs/nfs/inode.c | 2 +-
21 3 files changed, 8 insertions(+), 2 deletions(-)
22
23--- a/fs/nfs/delegation.h
24+++ b/fs/nfs/delegation.h
25@@ -71,4 +71,10 @@ static inline int nfs_inode_return_deleg
26 }
27 #endif
28
29+static inline int nfs_have_delegated_attributes(struct inode *inode)
30+{
31+ return nfs_have_delegation(inode, FMODE_READ) &&
32+ !(NFS_I(inode)->cache_validity & NFS_INO_REVAL_FORCED);
33+}
34+
35 #endif
36--- a/fs/nfs/dir.c
37+++ b/fs/nfs/dir.c
38@@ -1789,7 +1789,7 @@ static int nfs_access_get_cached(struct
39 cache = nfs_access_search_rbtree(inode, cred);
40 if (cache == NULL)
41 goto out;
42- if (!nfs_have_delegation(inode, FMODE_READ) &&
43+ if (!nfs_have_delegated_attributes(inode) &&
44 !time_in_range_open(jiffies, cache->jiffies, cache->jiffies + nfsi->attrtimeo))
45 goto out_stale;
46 res->jiffies = cache->jiffies;
47--- a/fs/nfs/inode.c
48+++ b/fs/nfs/inode.c
49@@ -759,7 +759,7 @@ int nfs_attribute_timeout(struct inode *
50 {
51 struct nfs_inode *nfsi = NFS_I(inode);
52
53- if (nfs_have_delegation(inode, FMODE_READ))
54+ if (nfs_have_delegated_attributes(inode))
55 return 0;
56 return !time_in_range_open(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
57 }