This is a note to let you know that I've just added the patch titled
NFS41: do not update isize if inode needs layoutcommit
to the 2.6.39-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nfs41-do-not-update-isize-if-inode-needs-layoutcommit.patch
and it can be found in the queue-2.6.39 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 0f66b5984df2fe1617c05900a39a7ef493ca9de9 Mon Sep 17 00:00:00 2001
From: Peng Tao <[email protected]>
Date: Sat, 16 Oct 2010 22:07:46 -0700
Subject: NFS41: do not update isize if inode needs layoutcommit
From: Peng Tao <[email protected]>
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 <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/nfs/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1294,7 +1294,8 @@ static int nfs_update_inode(struct inode
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 || new_isize > cur_isize) {
+ if ((nfsi->npages == 0 &&
!test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) ||
+ new_isize > cur_isize) {
i_size_write(inode, new_isize);
invalid |=
NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
}
Patches currently in stable-queue which might be from [email protected] are
queue-2.6.39/nfs41-do-not-update-isize-if-inode-needs-layoutcommit.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable