NFS: Simplify cache consistency in nfs_check_inode_attributes()
We should not be invalidating the access or acl caches in nfs_check_inode_attributes(), since the point is we're unsure about whether the contents of the struct nfs_fattr are fully up to date. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
c88c696c59
commit
04c63498b6
|
@ -1491,8 +1491,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
|
|||
if (!nfs_file_has_buffered_writers(nfsi)) {
|
||||
/* Verify a few of the more important attributes */
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_CHANGE) != 0 && !inode_eq_iversion_raw(inode, fattr->change_attr))
|
||||
invalid |= NFS_INO_INVALID_CHANGE
|
||||
| NFS_INO_REVAL_PAGECACHE;
|
||||
invalid |= NFS_INO_INVALID_CHANGE;
|
||||
|
||||
ts = inode->i_mtime;
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec64_equal(&ts, &fattr->mtime))
|
||||
|
@ -1506,24 +1505,17 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
|
|||
cur_size = i_size_read(inode);
|
||||
new_isize = nfs_size_to_loff_t(fattr->size);
|
||||
if (cur_size != new_isize)
|
||||
invalid |= NFS_INO_INVALID_SIZE
|
||||
| NFS_INO_REVAL_PAGECACHE;
|
||||
invalid |= NFS_INO_INVALID_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Have any file permissions changed? */
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_MODE) && (inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO))
|
||||
invalid |= NFS_INO_INVALID_ACCESS
|
||||
| NFS_INO_INVALID_ACL
|
||||
| NFS_INO_INVALID_MODE;
|
||||
invalid |= NFS_INO_INVALID_MODE;
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_OWNER) && !uid_eq(inode->i_uid, fattr->uid))
|
||||
invalid |= NFS_INO_INVALID_ACCESS
|
||||
| NFS_INO_INVALID_ACL
|
||||
| NFS_INO_INVALID_OTHER;
|
||||
invalid |= NFS_INO_INVALID_OTHER;
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_GROUP) && !gid_eq(inode->i_gid, fattr->gid))
|
||||
invalid |= NFS_INO_INVALID_ACCESS
|
||||
| NFS_INO_INVALID_ACL
|
||||
| NFS_INO_INVALID_OTHER;
|
||||
invalid |= NFS_INO_INVALID_OTHER;
|
||||
|
||||
/* Has the link count changed? */
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink)
|
||||
|
|
Loading…
Reference in New Issue