rpms/kernel/F-10 linux-2.6-nfsd-report-short-writes-fix.patch, NONE, 1.1.2.2 linux-2.6-nfsd-report-short-writes.patch, NONE, 1.1.2.2 kernel.spec, 1.1206.2.86, 1.1206.2.87
Chuck Ebbert
cebbert at fedoraproject.org
Sat Sep 5 02:53:41 UTC 2009
- Previous message (by thread): rpms/kernel/F-10 patch-2.6.27.31.bz2.sign, NONE, 1.1.2.1 patch-2.6.27.32-rc1.bz2.sign, NONE, 1.1.2.1 .cvsignore, 1.960.2.18, 1.960.2.19 kernel.spec, 1.1206.2.85, 1.1206.2.86 linux-2.6-upstream-reverts.patch, 1.6.2.1, 1.6.2.2 sources, 1.922.2.18, 1.922.2.19 upstream, 1.834.2.18, 1.834.2.19 do_sigaltstack-avoid-copying-stack_t-as-a-structure-to-userspace.patch, 1.1.2.2, NONE kvm-make-efer-reads-safe-when-efer-does-not-exist.patch, 1.1.2.1, NONE kvm-vmx-don-t-allow-uninhibited-access-to-efer-on-i386.patch, 1.1.2.1, NONE linux-2.6-cdrom-door-status.patch, 1.4.2.1, NONE linux-2.6-char-remove-low_latency-nozomi-mxser.patch, 1.1.2.1, NONE linux-2.6-parport-quickfix-the-proc-registration-bug.patch, 1.1.2.2, NONE linux-2.6-usb-remove-low-latency-hack.patch, 1.1.2.2, NONE patch-2.6.27.30.bz2.sign, 1.1.2.1, NONE
- Next message (by thread): rpms/kde-l10n/devel kde-l10n.spec,1.94,1.95
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28303
Modified Files:
Tag: private-fedora-10-2_6_27
kernel.spec
Added Files:
Tag: private-fedora-10-2_6_27
linux-2.6-nfsd-report-short-writes-fix.patch
linux-2.6-nfsd-report-short-writes.patch
Log Message:
Copy fix for NFS short write reporting from F-10 2.6.29 kernel (#493500)
linux-2.6-nfsd-report-short-writes-fix.patch:
vfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- 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;
linux-2.6-nfsd-report-short-writes.patch:
fs/nfsd/nfs3proc.c | 5 +++--
fs/nfsd/nfs4proc.c | 7 +++++--
fs/nfsd/nfsproc.c | 3 ++-
fs/nfsd/vfs.c | 13 +++++++------
include/linux/nfsd/nfsd.h | 2 +-
5 files changed, 18 insertions(+), 12 deletions(-)
--- NEW FILE linux-2.6-nfsd-report-short-writes.patch ---
From: David Shaw <dshaw at jabberwocky.com>
Date: Fri, 6 Mar 2009 01:16:14 +0000 (-0500)
Subject: Short write in nfsd becomes a full write to the client
X-Git-Tag: v2.6.30-rc1~183^2~52
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=31dec2538e45e9fff2007ea1f4c6bae9f78db724
Short write in nfsd becomes a full write to the client
If a filesystem being written to via NFS returns a short write count
(as opposed to an error) to nfsd, nfsd treats that as a success for
the entire write, rather than the short count that actually succeeded.
For example, given a 8192 byte write, if the underlying filesystem
only writes 4096 bytes, nfsd will ack back to the nfs client that all
8192 bytes were written. The nfs client does have retry logic for
short writes, but this is never called as the client is told the
complete write succeeded.
There are probably other ways it could happen, but in my case it
happened with a fuse (filesystem in userspace) filesystem which can
rather easily have a partial write.
Here is a patch to properly return the short write count to the
client.
Signed-off-by: David Shaw <dshaw at jabberwocky.com>
Signed-off-by: J. Bruce Fields <bfields at citi.umich.edu>
---
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 579ce8c..7c9fe83 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -203,6 +203,7 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
struct nfsd3_writeres *resp)
{
__be32 nfserr;
+ unsigned long cnt = argp->len;
dprintk("nfsd: WRITE(3) %s %d bytes at %ld%s\n",
SVCFH_fmt(&argp->fh),
@@ -215,9 +216,9 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
nfserr = nfsd_write(rqstp, &resp->fh, NULL,
argp->offset,
rqstp->rq_vec, argp->vlen,
- argp->len,
+ &cnt,
&resp->committed);
- resp->count = argp->count;
+ resp->count = cnt;
RETURN_STATUS(nfserr);
}
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 77f584f..283d77a 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -682,6 +682,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct file *filp = NULL;
u32 *p;
__be32 status = nfs_ok;
+ unsigned long cnt;
/* no need to check permission - this will be done in nfsd_write() */
@@ -700,7 +701,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
return status;
}
- write->wr_bytes_written = write->wr_buflen;
+ cnt = write->wr_buflen;
write->wr_how_written = write->wr_stable_how;
p = (u32 *)write->wr_verifier.data;
*p++ = nfssvc_boot.tv_sec;
@@ -708,10 +709,12 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfsd_write(rqstp, &cstate->current_fh, filp,
write->wr_offset, rqstp->rq_vec, write->wr_vlen,
- write->wr_buflen, &write->wr_how_written);
+ &cnt, &write->wr_how_written);
if (filp)
fput(filp);
+ write->wr_bytes_written = cnt;
+
if (status == nfserr_symlink)
status = nfserr_inval;
return status;
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 6f7f263..e298e26 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -180,6 +180,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
{
__be32 nfserr;
int stable = 1;
+ unsigned long cnt = argp->len;
dprintk("nfsd: WRITE %s %d bytes at %d\n",
SVCFH_fmt(&argp->fh),
@@ -188,7 +189,7 @@ nfsd_proc_write(struct svc_rqst *rqstp, struct nfsd_writeargs *argp,
nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
argp->offset,
rqstp->rq_vec, argp->vlen,
- argp->len,
+ &cnt,
&stable);
return nfsd_return_attrs(nfserr, resp);
}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 0c07629..54404d7 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -960,7 +960,7 @@ static void kill_suid(struct dentry *dentry)
static __be32
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
loff_t offset, struct kvec *vec, int vlen,
- unsigned long cnt, int *stablep)
+ unsigned long *cnt, int *stablep)
{
struct svc_export *exp;
struct dentry *dentry;
@@ -974,7 +974,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
err = nfserr_perm;
if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
- (!lock_may_write(file->f_path.dentry->d_inode, offset, cnt)))
+ (!lock_may_write(file->f_path.dentry->d_inode, offset, *cnt)))
goto out;
#endif
@@ -1006,7 +1006,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) {
- nfsdstats.io_write += cnt;
+ nfsdstats.io_write += host_err;
fsnotify_modify(file->f_path.dentry);
}
@@ -1051,9 +1051,10 @@ 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;
- else
+ *cnt = host_err;
+ } else
err = nfserrno(host_err);
out:
return err;
@@ -1095,7 +1096,7 @@ out:
*/
__be32
nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
- loff_t offset, struct kvec *vec, int vlen, unsigned long cnt,
+ loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt,
int *stablep)
{
__be32 err = 0;
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 16f7b40..54beda1 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -105,7 +105,7 @@ void nfsd_close(struct file *);
__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
loff_t, struct kvec *, int, unsigned long *);
__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
- loff_t, struct kvec *,int, unsigned long, int *);
+ loff_t, struct kvec *,int, unsigned long *, int *);
__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
char *, int *);
__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1206.2.86
retrieving revision 1.1206.2.87
diff -u -p -r1.1206.2.86 -r1.1206.2.87
--- kernel.spec 5 Sep 2009 02:40:58 -0000 1.1206.2.86
+++ kernel.spec 5 Sep 2009 02:53:39 -0000 1.1206.2.87
@@ -778,6 +778,10 @@ Patch12000: linux-2.6-virtio-blk-dont-bo
Patch13000: make-mmap_min_addr-suck-less.patch
+# fix NFS short writes (#493500)
+Patch14000: linux-2.6-nfsd-report-short-writes-fix.patch
+Patch14001: linux-2.6-nfsd-report-short-writes.patch
+
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1405,6 +1409,10 @@ ApplyPatch linux-2.6-virtio-blk-dont-bou
ApplyPatch make-mmap_min_addr-suck-less.patch
+# fix NFS short writes (#493500)
+ApplyPatch linux-2.6-nfsd-report-short-writes.patch
+ApplyPatch linux-2.6-nfsd-report-short-writes-fix.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -1980,6 +1988,9 @@ fi
%kernel_variant_files -k vmlinux %{with_kdump} kdump
%changelog
+* Fri Sep 04 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.32-170.2.87.rc1
+- Copy fix for NFS short write reporting from F-10 2.6.29 kernel (#493500)
+
* Fri Sep 04 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.32-170.2.86.rc1
- 2.6.27.31: no functional changes, update had been manually applied already.
- 2.6.27.32-rc1: drop upstream patches:
- Previous message (by thread): rpms/kernel/F-10 patch-2.6.27.31.bz2.sign, NONE, 1.1.2.1 patch-2.6.27.32-rc1.bz2.sign, NONE, 1.1.2.1 .cvsignore, 1.960.2.18, 1.960.2.19 kernel.spec, 1.1206.2.85, 1.1206.2.86 linux-2.6-upstream-reverts.patch, 1.6.2.1, 1.6.2.2 sources, 1.922.2.18, 1.922.2.19 upstream, 1.834.2.18, 1.834.2.19 do_sigaltstack-avoid-copying-stack_t-as-a-structure-to-userspace.patch, 1.1.2.2, NONE kvm-make-efer-reads-safe-when-efer-does-not-exist.patch, 1.1.2.1, NONE kvm-vmx-don-t-allow-uninhibited-access-to-efer-on-i386.patch, 1.1.2.1, NONE linux-2.6-cdrom-door-status.patch, 1.4.2.1, NONE linux-2.6-char-remove-low_latency-nozomi-mxser.patch, 1.1.2.1, NONE linux-2.6-parport-quickfix-the-proc-registration-bug.patch, 1.1.2.2, NONE linux-2.6-usb-remove-low-latency-hack.patch, 1.1.2.2, NONE patch-2.6.27.30.bz2.sign, 1.1.2.1, NONE
- Next message (by thread): rpms/kde-l10n/devel kde-l10n.spec,1.94,1.95
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list