diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2018-03-27 18:30:42 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-05-31 15:02:16 -0400 |
commit | 821a868a2316de95250d3069a7b8025ec24154a6 (patch) | |
tree | 90d088d258a5fa76524a378b23d42eb38c221659 /fs/nfs/inode.c | |
parent | 3cb3fd6da4e9c810f7d9322fd36a5b39941ce409 (diff) |
NFS: Set the force revalidate flag if the inode is not completely initialised
Ensure that a delegation doesn't cause us to skip initialising the inode
if it was incomplete when we exited nfs_fhget()
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index bd15d0b57626..40a6cf6db4e8 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -448,6 +448,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st | |||
448 | /* We can't support update_atime(), since the server will reset it */ | 448 | /* We can't support update_atime(), since the server will reset it */ |
449 | inode->i_flags |= S_NOATIME|S_NOCMTIME; | 449 | inode->i_flags |= S_NOATIME|S_NOCMTIME; |
450 | inode->i_mode = fattr->mode; | 450 | inode->i_mode = fattr->mode; |
451 | nfsi->cache_validity = 0; | ||
451 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 | 452 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 |
452 | && nfs_server_capable(inode, NFS_CAP_MODE)) | 453 | && nfs_server_capable(inode, NFS_CAP_MODE)) |
453 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_OTHER); | 454 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_OTHER); |
@@ -534,6 +535,9 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st | |||
534 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); | 535 | inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used); |
535 | } | 536 | } |
536 | 537 | ||
538 | if (nfsi->cache_validity != 0) | ||
539 | nfsi->cache_validity |= NFS_INO_REVAL_FORCED; | ||
540 | |||
537 | nfs_setsecurity(inode, fattr, label); | 541 | nfs_setsecurity(inode, fattr, label); |
538 | 542 | ||
539 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); | 543 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); |