rpms/kernel/F-10 linux-2.6-nfsd-report-short-writes-fix.patch, NONE, 1.1 kernel.spec, 1.1388, 1.1389

Chuck Ebbert cebbert at fedoraproject.org
Wed Jul 1 03:38:37 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18603

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-nfsd-report-short-writes-fix.patch 
Log Message:
Fix NFS, broken by the report-short-writes patch (#508095)

linux-2.6-nfsd-report-short-writes-fix.patch:

--- NEW FILE linux-2.6-nfsd-report-short-writes-fix.patch ---
From: Wei Yongjun <yjwei at cn.fujitsu.com>
Date: Tue, 19 May 2009 04:03:15 +0000 (+0800)
Subject: nfsd: fix hung up of nfs client while sync write data to nfs server
X-Git-Tag: v2.6.30-rc8~20^2~2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a0d24b295aed7a9daf4ca36bd4784e4d40f82303

nfsd: fix hung up of nfs client while sync write data to nfs server

Commit 'Short write in nfsd becomes a full write to the client'
(31dec2538e45e9fff2007ea1f4c6bae9f78db724) broken the sync write.
With the following commands to reproduce:

  $ mount -t nfs -o sync 192.168.0.21:/nfsroot /mnt
  $ cd /mnt
  $ echo aaaa > temp.txt

Then nfs client is hung up.

In SYNC mode the server alaways return the write count 0 to the
client. This is because the value of host_err in nfsd_vfs_write()
will be overwrite in SYNC mode by 'host_err=nfsd_sync(file);',
and then we return host_err(which is now 0) as write count.

This patch fixed the problem.

Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields at citi.umich.edu>
---

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6c68ffd..b660435 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1015,6 +1015,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 	host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
 	set_fs(oldfs);
 	if (host_err >= 0) {
+		*cnt = host_err;
 		nfsdstats.io_write += host_err;
 		fsnotify_modify(file->f_path.dentry);
 	}
@@ -1060,10 +1061,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 	}
 
 	dprintk("nfsd: write complete host_err=%d\n", host_err);
-	if (host_err >= 0) {
+	if (host_err >= 0)
 		err = 0;
-		*cnt = host_err;
-	} else
+	else
 		err = nfserrno(host_err);
 out:
 	return err;


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1388
retrieving revision 1.1389
diff -u -p -r1.1388 -r1.1389
--- kernel.spec	30 Jun 2009 05:02:32 -0000	1.1388
+++ kernel.spec	1 Jul 2009 03:38:05 -0000	1.1389
@@ -719,6 +719,7 @@ Patch9001: squashfs-fixups.patch
 
 Patch9010: revert-fix-modules_install-via-nfs.patch
 Patch9011: linux-2.6-nfsd-report-short-writes.patch
+Patch9012: linux-2.6-nfsd-report-short-writes-fix.patch
 
 #Adding dropmonitor bits from 2.6.30
 Patch9100: linux-2.6-dropwatch-protocol.patch
@@ -1361,6 +1362,8 @@ ApplyPatch revert-fix-modules_install-vi
 
 # fix nfs reporting of short writes (#493500)
 ApplyPatch linux-2.6-nfsd-report-short-writes.patch
+# fix the fix (#508095)
+ApplyPatch linux-2.6-nfsd-report-short-writes-fix.patch
 
 # Apply dropmonitor protocol bits from 2.6..30 net-next tree
 ApplyPatch linux-2.6-dropwatch-protocol.patch
@@ -1957,6 +1960,9 @@ fi
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Tue Jun 30 2009 Chuck Ebbert <cebbert at redhat.com> kernel-2.6.29.5-89
+- Fix NFS, broken by the report-short-writes patch (#508095)
+
 * Tue Jun 30 2009 Jarod Wilson <jarod at redhat.com>
 - Fix broken lirc_serial (F11#504402)
 




More information about the fedora-extras-commits mailing list