diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2016-07-28 14:41:10 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-28 14:49:08 -0400 |
commit | 944171cbf499d3445c749f7c13c46de0a564a905 (patch) | |
tree | fb4d338b9f580419e59da2bc59ad2f9733ed02d3 | |
parent | 698c937b0d17dd55227622b919482fc720cc1095 (diff) |
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 10b7e9ad4488: "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 <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/inode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index f108d58101f8..bf4ec5ecc97e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1665,7 +1665,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1665 | unsigned long now = jiffies; | 1665 | unsigned long now = jiffies; |
1666 | unsigned long save_cache_validity; | 1666 | unsigned long save_cache_validity; |
1667 | bool have_writers = nfs_file_has_buffered_writers(nfsi); | 1667 | bool have_writers = nfs_file_has_buffered_writers(nfsi); |
1668 | bool cache_revalidated; | 1668 | bool cache_revalidated = true; |
1669 | 1669 | ||
1670 | dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n", | 1670 | dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n", |
1671 | __func__, inode->i_sb->s_id, inode->i_ino, | 1671 | __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) | |||
1714 | /* Do atomic weak cache consistency updates */ | 1714 | /* Do atomic weak cache consistency updates */ |
1715 | invalid |= nfs_wcc_update_inode(inode, fattr); | 1715 | invalid |= nfs_wcc_update_inode(inode, fattr); |
1716 | 1716 | ||
1717 | 1717 | if (pnfs_layoutcommit_outstanding(inode)) { | |
1718 | cache_revalidated = !pnfs_layoutcommit_outstanding(inode); | 1718 | nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_ATTR; |
1719 | cache_revalidated = false; | ||
1720 | } | ||
1719 | 1721 | ||
1720 | /* More cache consistency checks */ | 1722 | /* More cache consistency checks */ |
1721 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) { | 1723 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) { |