summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-06-17 16:48:27 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-06-24 12:01:00 -0400
commitd8fdb47fae5febc02e62da121f85625244b98b2e (patch)
tree4269a98d63d64fb73db5bf713bfae95cb0d148b3 /fs
parent2d148c7e84962429a79092a56d3736a8d984f595 (diff)
downloadlinux-d8fdb47fae5febc02e62da121f85625244b98b2e.tar.gz
linux-d8fdb47fae5febc02e62da121f85625244b98b2e.tar.bz2
linux-d8fdb47fae5febc02e62da121f85625244b98b2e.zip
NFS: Don't let readdirplus revalidate an inode that was marked as stale
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index aaf7bd0cbae2..a924d66b5608 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -424,12 +424,17 @@ static int xdr_decode(nfs_readdir_descriptor_t *desc,
static
int nfs_same_file(struct dentry *dentry, struct nfs_entry *entry)
{
+ struct inode *inode;
struct nfs_inode *nfsi;
if (d_really_is_negative(dentry))
return 0;
- nfsi = NFS_I(d_inode(dentry));
+ inode = d_inode(dentry);
+ if (is_bad_inode(inode) || NFS_STALE(inode))
+ return 0;
+
+ nfsi = NFS_I(inode);
if (entry->fattr->fileid == nfsi->fileid)
return 1;
if (nfs_compare_fh(entry->fh, &nfsi->fh) == 0)