Skip to content

Commit 10b7e9a

Browse files
committed
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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 8b7d9d0 commit 10b7e9a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

fs/nfs/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
16641664
unsigned long now = jiffies;
16651665
unsigned long save_cache_validity;
16661666
bool have_writers = nfs_file_has_buffered_writers(nfsi);
1667-
bool cache_revalidated = true;
1667+
bool cache_revalidated;
16681668

16691669
dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
16701670
__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)
17131713
/* Do atomic weak cache consistency updates */
17141714
invalid |= nfs_wcc_update_inode(inode, fattr);
17151715

1716+
1717+
cache_revalidated = !pnfs_layoutcommit_outstanding(inode);
1718+
17161719
/* More cache consistency checks */
17171720
if (fattr->valid & NFS_ATTR_FATTR_CHANGE) {
17181721
if (inode->i_version != fattr->change_attr) {

fs/nfs/pnfs.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,13 @@ pnfs_sync_inode(struct inode *inode, bool datasync)
628628
return 0;
629629
}
630630

631+
static inline bool
632+
pnfs_layoutcommit_outstanding(struct inode *inode)
633+
{
634+
return false;
635+
}
636+
637+
631638
static inline bool
632639
pnfs_roc(struct inode *ino)
633640
{

0 commit comments

Comments
 (0)