Commit f6cdfa6d authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

NFSv4: Declare the size up to date after it was set.

When we've changed the file size, then ensure we declare it to be
up to date in the inode attributes.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent aae5730e
...@@ -646,6 +646,7 @@ static int nfs_vmtruncate(struct inode * inode, loff_t offset) ...@@ -646,6 +646,7 @@ static int nfs_vmtruncate(struct inode * inode, loff_t offset)
/* Optimisation */ /* Optimisation */
if (offset == 0) if (offset == 0)
NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_DATA; NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_DATA;
NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
truncate_pagecache(inode, offset); truncate_pagecache(inode, offset);
......
...@@ -231,6 +231,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c ...@@ -231,6 +231,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
if (i_size >= end) if (i_size >= end)
goto out; goto out;
i_size_write(inode, end); i_size_write(inode, end);
NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
nfs_inc_stats(inode, NFSIOS_EXTENDWRITE); nfs_inc_stats(inode, NFSIOS_EXTENDWRITE);
out: out:
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment