diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-08 09:24:22 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:20:47 -0400 |
commit | 40d24704091c8a29a4c99d25670f1996749aea6f (patch) | |
tree | 511140e99865bd1610a6df1bd81c9321b7749005 /fs/nfs | |
parent | 9e08a3c5aec5b745e844328bcbc16458b6118faf (diff) |
NFS: Fix a connectathon regression in NFSv3 and NFSv4
We're failing basic test6 against Linux servers because they lack a correct
change attribute. The fix is to assume that we always want to invalidate
the readdir caches when we call update_changeattr and/or
nfs_post_op_update_inode on a directory.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 10 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 469387920dd9..c44cd02e5181 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -876,11 +876,19 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
876 | { | 876 | { |
877 | struct nfs_inode *nfsi = NFS_I(inode); | 877 | struct nfs_inode *nfsi = NFS_I(inode); |
878 | 878 | ||
879 | if (fattr->valid & NFS_ATTR_FATTR) | 879 | if (fattr->valid & NFS_ATTR_FATTR) { |
880 | if (S_ISDIR(inode->i_mode)) { | ||
881 | spin_lock(&inode->i_lock); | ||
882 | nfsi->cache_validity |= NFS_INO_INVALID_DATA; | ||
883 | spin_unlock(&inode->i_lock); | ||
884 | } | ||
880 | return nfs_refresh_inode(inode, fattr); | 885 | return nfs_refresh_inode(inode, fattr); |
886 | } | ||
881 | 887 | ||
882 | spin_lock(&inode->i_lock); | 888 | spin_lock(&inode->i_lock); |
883 | nfsi->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE; | 889 | nfsi->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE; |
890 | if (S_ISDIR(inode->i_mode)) | ||
891 | nfsi->cache_validity |= NFS_INO_INVALID_DATA; | ||
884 | spin_unlock(&inode->i_lock); | 892 | spin_unlock(&inode->i_lock); |
885 | return 0; | 893 | return 0; |
886 | } | 894 | } |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 30d5dd5735cd..cb99fd90a9ac 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -208,12 +208,10 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo) | |||
208 | struct nfs_inode *nfsi = NFS_I(dir); | 208 | struct nfs_inode *nfsi = NFS_I(dir); |
209 | 209 | ||
210 | spin_lock(&dir->i_lock); | 210 | spin_lock(&dir->i_lock); |
211 | if (cinfo->after != nfsi->change_attr) { | 211 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA; |
212 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA; | 212 | if (!cinfo->atomic || cinfo->before != nfsi->change_attr) |
213 | if (!cinfo->atomic || cinfo->before != nfsi->change_attr) | 213 | nfsi->cache_change_attribute = jiffies; |
214 | nfsi->cache_change_attribute = jiffies; | 214 | nfsi->change_attr = cinfo->after; |
215 | nfsi->change_attr = cinfo->after; | ||
216 | } | ||
217 | spin_unlock(&dir->i_lock); | 215 | spin_unlock(&dir->i_lock); |
218 | } | 216 | } |
219 | 217 | ||