diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-18 00:51:01 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-18 00:51:01 -0400 |
commit | 10b7e9ad44881fcd46ac24eb7374377c6e8962ed (patch) | |
tree | 527550c46187a348320564bb451791f29ad17d75 | |
parent | 8b7d9d09b24f4ef16f7ae34b6d9e59857fda0870 (diff) |
pNFS: Don't mark the inode as revalidated if a LAYOUTCOMMIT is outstanding
We know that the attributes will need updating if there is still a
LAYOUTCOMMIT outstanding.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/inode.c | 5 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 35fda08dc4f6..9df45832e28b 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1664,7 +1664,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1664 | unsigned long now = jiffies; | 1664 | unsigned long now = jiffies; |
1665 | unsigned long save_cache_validity; | 1665 | unsigned long save_cache_validity; |
1666 | bool have_writers = nfs_file_has_buffered_writers(nfsi); | 1666 | bool have_writers = nfs_file_has_buffered_writers(nfsi); |
1667 | bool cache_revalidated = true; | 1667 | bool cache_revalidated; |
1668 | 1668 | ||
1669 | dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n", | 1669 | dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n", |
1670 | __func__, inode->i_sb->s_id, inode->i_ino, | 1670 | __func__, inode->i_sb->s_id, inode->i_ino, |
@@ -1713,6 +1713,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1713 | /* Do atomic weak cache consistency updates */ | 1713 | /* Do atomic weak cache consistency updates */ |
1714 | invalid |= nfs_wcc_update_inode(inode, fattr); | 1714 | invalid |= nfs_wcc_update_inode(inode, fattr); |
1715 | 1715 | ||
1716 | |||
1717 | cache_revalidated = !pnfs_layoutcommit_outstanding(inode); | ||
1718 | |||
1716 | /* More cache consistency checks */ | 1719 | /* More cache consistency checks */ |
1717 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) { | 1720 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) { |
1718 | if (inode->i_version != fattr->change_attr) { | 1721 | if (inode->i_version != fattr->change_attr) { |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index d6be5299a55a..181283c4ebc3 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -629,6 +629,13 @@ pnfs_sync_inode(struct inode *inode, bool datasync) | |||
629 | } | 629 | } |
630 | 630 | ||
631 | static inline bool | 631 | static inline bool |
632 | pnfs_layoutcommit_outstanding(struct inode *inode) | ||
633 | { | ||
634 | return false; | ||
635 | } | ||
636 | |||
637 | |||
638 | static inline bool | ||
632 | pnfs_roc(struct inode *ino) | 639 | pnfs_roc(struct inode *ino) |
633 | { | 640 | { |
634 | return false; | 641 | return false; |