NFS41: do not update isize if inode needs layoutcommit
commit712283fb329cf8ff02e72f2f70cf735f01f7c040
authorPeng Tao <bergwolf@gmail.com>
Sun, 17 Oct 2010 05:07:46 +0000 (16 22:07 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 9 Jul 2011 06:15:13 +0000 (8 23:15 -0700)
treead5183fabbf3f2d92f2852d2e27c7a5a6e26f28b
parentd1229b3c4d52210b6ee09902b5a705c6509eeb1a
NFS41: do not update isize if inode needs layoutcommit

commit 0f66b5984df2fe1617c05900a39a7ef493ca9de9 upstream.

nfs_update_inode will update isize if there is no queued pages. For pNFS,
layoutcommit is supposed to change file size on server, the same effect as queued
pages. nfs_update_inode may be called when dirty pages are written back (nfsi->npages==0)
but layoutcommit is not sent, and it will change client file size according to server
file size. Then client ends up losing what it just writes back in pNFS path.
So we should skip updating client file size if file needs layoutcommit.

Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/inode.c