Skip to content

Commit

Permalink
pNFS: Don't mark the inode as revalidated if a LAYOUTCOMMIT is outsta…
Browse files Browse the repository at this point in the history
…nding

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>
  • Loading branch information
Trond Myklebust committed Jul 18, 2016
1 parent 8b7d9d0 commit 10b7e9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
unsigned long now = jiffies;
unsigned long save_cache_validity;
bool have_writers = nfs_file_has_buffered_writers(nfsi);
bool cache_revalidated = true;
bool cache_revalidated;

dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
__func__, inode->i_sb->s_id, inode->i_ino,
Expand Down Expand Up @@ -1713,6 +1713,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
/* Do atomic weak cache consistency updates */
invalid |= nfs_wcc_update_inode(inode, fattr);


cache_revalidated = !pnfs_layoutcommit_outstanding(inode);

/* More cache consistency checks */
if (fattr->valid & NFS_ATTR_FATTR_CHANGE) {
if (inode->i_version != fattr->change_attr) {
Expand Down
7 changes: 7 additions & 0 deletions fs/nfs/pnfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ pnfs_sync_inode(struct inode *inode, bool datasync)
return 0;
}

static inline bool
pnfs_layoutcommit_outstanding(struct inode *inode)
{
return false;
}


static inline bool
pnfs_roc(struct inode *ino)
{
Expand Down

0 comments on commit 10b7e9a

Please sign in to comment.