2005-09-20 22:19:56

by Steven Procter

[permalink] [raw]
Subject: [PATCH] Minor problem in nfsv3 write


The following changes the nfs write procedure so that it reports the
number of bytes written correctly when the requested write size execeeds
the server's maximum write transfer size. The server was reporting that
it wrote the number of bytes the client requested, but in fact it only
wrote the max transfer size.

For linux-2.6.13.2.

--Steven Procter

--- fs/nfsd/nfs3xdr.c.orig 2005-09-20 13:49:52.000000000 -0700
+++ fs/nfsd/nfs3xdr.c 2005-09-20 13:49:53.000000000 -0700
@@ -372,8 +372,10 @@ nfs3svc_decode_writeargs(struct svc_rqst
args->vec[0].iov_base = (void*)p;
args->vec[0].iov_len = rqstp->rq_arg.head[0].iov_len - hdr;

- if (len > NFSSVC_MAXBLKSIZE)
+ if (len > NFSSVC_MAXBLKSIZE) {
len = NFSSVC_MAXBLKSIZE;
+ args->count = len;
+ }
v= 0;
while (len > args->vec[v].iov_len) {
len -= args->vec[v].iov_len;
@@ -384,7 +386,7 @@ nfs3svc_decode_writeargs(struct svc_rqst
args->vec[v].iov_len = len;
args->vlen = v+1;

- return args->count == args->len && args->vec[0].iov_len > 0;
+ return args->count <= args->len && args->vec[0].iov_len > 0;
}

int


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2005-09-20 23:46:22

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH] Minor problem in nfsv3 write

On Tue, Sep 20, 2005 at 03:19:10PM -0700, Steven wrote:
>
> The following changes the nfs write procedure so that it reports the
> number of bytes written correctly when the requested write size execeeds
> the server's maximum write transfer size. The server was reporting that
> it wrote the number of bytes the client requested, but in fact it only
> wrote the max transfer size.
>
> For linux-2.6.13.2.
>
> --Steven Procter

Thanks. For next time; note that these should apply with -p1, so should
have another pathname component at the beginning:

> --- fs/nfsd/nfs3xdr.c.orig 2005-09-20 13:49:52.000000000 -0700
> +++ fs/nfsd/nfs3xdr.c 2005-09-20 13:49:53.000000000 -0700

Again, this is in Documentation/SubmittingPatches.

(We all have scripts to automate the process, which are happier if
everyone follows the same conventions.)

--b.


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs