Skip to content

Commit

Permalink
NFS: Don't flush caches for a getattr that races with writeback
Browse files Browse the repository at this point in the history
If there were outstanding writes then chalk up the unexpected change
attribute on the server to them.

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
trondmypd committed Jun 13, 2016
1 parent 5edb564 commit 38512aa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,12 +1729,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
if (inode->i_version != fattr->change_attr) {
dprintk("NFS: change_attr change on server for file %s/%ld\n",
inode->i_sb->s_id, inode->i_ino);
invalid |= NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_DATA
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL;
if (S_ISDIR(inode->i_mode))
nfs_force_lookup_revalidate(inode);
/* Could it be a race with writeback? */
if (nfsi->nrequests == 0) {
invalid |= NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_DATA
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL;
if (S_ISDIR(inode->i_mode))
nfs_force_lookup_revalidate(inode);
}
inode->i_version = fattr->change_attr;
}
} else {
Expand Down

0 comments on commit 38512aa

Please sign in to comment.