Skip to content

Commit 944171c

Browse files
bcodding-rhtrondmypd
authored andcommitted
pNFS: Actively set attributes as invalid if LAYOUTCOMMIT is outstanding
A LAYOUTCOMMIT then subsequent GETATTR may both return the same attributes, and in that case NFS_INO_INVALID_ATTR is never set on the second pass through nfs_update_inode(). The existing check to skip the clearing of NFS_INO_INVALID_ATTR if a LAYOUTCOMMIT is outstanding does not help in this case (see commit 10b7e9a: "pNFS: Don't mark the inode as revalidated if a LAYOUTCOMMIT is outstanding"). We know that if a LAYOUTCOMMIT is outstanding then attributes will need upating, so always set NFS_INO_INVALID_ATTR. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 698c937 commit 944171c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/nfs/inode.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
16651665
unsigned long now = jiffies;
16661666
unsigned long save_cache_validity;
16671667
bool have_writers = nfs_file_has_buffered_writers(nfsi);
1668-
bool cache_revalidated;
1668+
bool cache_revalidated = true;
16691669

16701670
dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
16711671
__func__, inode->i_sb->s_id, inode->i_ino,
@@ -1714,8 +1714,10 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
17141714
/* Do atomic weak cache consistency updates */
17151715
invalid |= nfs_wcc_update_inode(inode, fattr);
17161716

1717-
1718-
cache_revalidated = !pnfs_layoutcommit_outstanding(inode);
1717+
if (pnfs_layoutcommit_outstanding(inode)) {
1718+
nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_ATTR;
1719+
cache_revalidated = false;
1720+
}
17191721

17201722
/* More cache consistency checks */
17211723
if (fattr->valid & NFS_ATTR_FATTR_CHANGE) {

0 commit comments

Comments
 (0)