All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSD: Fix bad checking of space for padding in splice read
@ 2014-07-09 13:51 Kinglong Mee
  2014-07-11 19:17 ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Kinglong Mee @ 2014-07-09 13:51 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing List, kinglongmee

Fix commit dc97618ddd (nfsd4: separate splice and readv cases).
xdr->end and xdr->p are type of __be32 *, so padding needs one here.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4xdr.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 523c666..8a2fbb2 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3067,11 +3067,8 @@ static __be32 nfsd4_encode_splice_read(
 	__be32 nfserr;
 	__be32 *p = xdr->p - 2;
 
-	/*
-	 * Don't inline pages unless we know there's room for eof,
-	 * count, and possible padding:
-	 */
-	if (xdr->end - xdr->p < 3)
+	/* Make sure there will be room for padding if needed */
+	if (xdr->end - xdr->p < 1)
 		return nfserr_resource;
 
 	nfserr = nfsd_splice_read(read->rd_rqstp, file,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFSD: Fix bad checking of space for padding in splice read
  2014-07-09 13:51 [PATCH] NFSD: Fix bad checking of space for padding in splice read Kinglong Mee
@ 2014-07-11 19:17 ` J. Bruce Fields
  2014-07-11 19:19   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2014-07-11 19:17 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: Linux NFS Mailing List

On Wed, Jul 09, 2014 at 09:51:27PM +0800, Kinglong Mee wrote:
> Fix commit dc97618ddd (nfsd4: separate splice and readv cases).
> xdr->end and xdr->p are type of __be32 *, so padding needs one here.

I agree with the patch, but not the changelog.

The problem here is that xdr->p isn't that those are __be32 *'s, but
that xdr->p has already advanced past the eof and the count, right?

Applying with an updated changelog.

--b.

> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/nfs4xdr.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 523c666..8a2fbb2 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -3067,11 +3067,8 @@ static __be32 nfsd4_encode_splice_read(
>  	__be32 nfserr;
>  	__be32 *p = xdr->p - 2;
>  
> -	/*
> -	 * Don't inline pages unless we know there's room for eof,
> -	 * count, and possible padding:
> -	 */
> -	if (xdr->end - xdr->p < 3)
> +	/* Make sure there will be room for padding if needed */
> +	if (xdr->end - xdr->p < 1)
>  		return nfserr_resource;
>  
>  	nfserr = nfsd_splice_read(read->rd_rqstp, file,
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFSD: Fix bad checking of space for padding in splice read
  2014-07-11 19:17 ` J. Bruce Fields
@ 2014-07-11 19:19   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2014-07-11 19:19 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: Linux NFS Mailing List

On Fri, Jul 11, 2014 at 03:17:47PM -0400, J. Bruce Fields wrote:
> On Wed, Jul 09, 2014 at 09:51:27PM +0800, Kinglong Mee wrote:
> > Fix commit dc97618ddd (nfsd4: separate splice and readv cases).
> > xdr->end and xdr->p are type of __be32 *, so padding needs one here.
> 
> I agree with the patch, but not the changelog.
> 
> The problem here is that xdr->p isn't that those are __be32 *'s, but
> that xdr->p has already advanced past the eof and the count, right?
> 
> Applying with an updated changelog.

(And applying for 3.17 (not 3.16) as this looks hard to hit.)

--b.


> 
> --b.
> 
> > 
> > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> > ---
> >  fs/nfsd/nfs4xdr.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> > index 523c666..8a2fbb2 100644
> > --- a/fs/nfsd/nfs4xdr.c
> > +++ b/fs/nfsd/nfs4xdr.c
> > @@ -3067,11 +3067,8 @@ static __be32 nfsd4_encode_splice_read(
> >  	__be32 nfserr;
> >  	__be32 *p = xdr->p - 2;
> >  
> > -	/*
> > -	 * Don't inline pages unless we know there's room for eof,
> > -	 * count, and possible padding:
> > -	 */
> > -	if (xdr->end - xdr->p < 3)
> > +	/* Make sure there will be room for padding if needed */
> > +	if (xdr->end - xdr->p < 1)
> >  		return nfserr_resource;
> >  
> >  	nfserr = nfsd_splice_read(read->rd_rqstp, file,
> > -- 
> > 1.9.3
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-11 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-09 13:51 [PATCH] NFSD: Fix bad checking of space for padding in splice read Kinglong Mee
2014-07-11 19:17 ` J. Bruce Fields
2014-07-11 19:19   ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.