public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: don't update isize when NFS_INO_LAYOUTCOMMITTING in nfs_update_inode
@ 2014-01-13  7:55 shaobingqing
  2014-01-13 13:34 ` Trond Myklebust
  0 siblings, 1 reply; 8+ messages in thread
From: shaobingqing @ 2014-01-13  7:55 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs, linux-kernel, shaobingqing

When a file is in NFS_INO_LAYOUTCOMMITING status, its isize perhaps has not been 
transferred to the metadate server. So the isize getting from the metadata server
perhaps is out of date and cannot be used to update the isize of the client.

Signed-off-by: shaobingqing <shaobingqing@bwstor.com.cn>
---
 fs/nfs/inode.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index ebeb94c..caf50a1 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1402,7 +1402,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 		if (new_isize != cur_isize) {
 			/* Do we perhaps have any outstanding writes, or has
 			 * the file grown beyond our last write? */
-			if ((nfsi->npages == 0 && !test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) ||
+			if ((nfsi->npages == 0 && !test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags) &&
+			     !test_bit(NFS_INO_LAYOUTCOMMITTING, &nfsi->flags)) ||
 			     new_isize > cur_isize) {
 				i_size_write(inode, new_isize);
 				invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
-- 
1.7.4.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-17 13:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13  7:55 [PATCH] nfs: don't update isize when NFS_INO_LAYOUTCOMMITTING in nfs_update_inode shaobingqing
2014-01-13 13:34 ` Trond Myklebust
2014-01-13 16:28   ` Trond Myklebust
2014-01-13 18:45     ` [PATCH 1/2] NFSv4.1: Don't trust attributes if a pNFS LAYOUTCOMMIT is outstanding Trond Myklebust
2014-01-13 18:45     ` [PATCH 2/2] NFSv4.1: Fix a race in nfs4_write_inode Trond Myklebust
2014-01-16 15:49       ` Peng Tao
2014-01-16 17:11         ` Trond Myklebust
2014-01-17 13:05           ` Peng Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox