Re: nfs regression 2.6.35+

From: Trond Myklebust
Date: Mon Aug 16 2010 - 18:48:06 EST


On Mon, 2010-08-16 at 15:06 +0800, Shaohua Li wrote:
> NFS client runs latest git. At client side, use vim to edit a file located at
> NFS server. If I save the file, vim always reports 'E667: Fsync failed'. If I
> revert f7fa16506bf9b6323e862a61e14c20555152bb3, vim works. No kernel errors
> reported.
>
> Thanks,
> Shaohua
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

There is already a fix for this in the linux-next tree and in the
'bugfixes' branch of
git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git: see commit
0702099bd86c33c2dcdbd3963433a61f3f503901 (NFS: fix the return value of
nfs_file_fsync()).

I haven't pushed it to Linus yet due to excessive travel this past week.
Will do so soon.

Cheers
Trond

----------------------------------------------------------------------------------------
commit 0702099bd86c33c2dcdbd3963433a61f3f503901
Author: J. R. Okajima <hooanon05@xxxxxxxxxxx>
Date: Wed Aug 11 13:10:16 2010 -0400

NFS: fix the return value of nfs_file_fsync()

By the commit af7fa16 2010-08-03 NFS: Fix up the fsync code
close(2) became returning the non-zero value even if it went well.
nfs_file_fsync() should return 0 when "status" is positive.

Signed-off-by: J. R. Okajima <hooanon05@xxxxxxxxxxx>
Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 2d141a7..eb51bd6 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -323,7 +323,7 @@ nfs_file_fsync(struct file *file, int datasync)
have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
if (have_error)
ret = xchg(&ctx->error, 0);
- if (!ret)
+ if (!ret && status < 0)
ret = status;
return ret;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/