Skip to content

Commit

Permalink
NFS: Don't let readdirplus revalidate an inode that was marked as stale
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Trond Myklebust authored and Anna Schumaker committed Jun 24, 2016
1 parent 2d148c7 commit d8fdb47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d8fdb47

Please sign in to comment.