Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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);
+1 −0
Original line number Original line Diff line number Diff line
@@ -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);