Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] NFSD: Fix bad checking of space for padding in splice read
Date: Fri, 11 Jul 2014 15:17:48 -0400	[thread overview]
Message-ID: <20140711191747.GF9775@fieldses.org> (raw)
In-Reply-To: <53BD48DF.2050506@gmail.com>

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
> 

  reply	other threads:[~2014-07-11 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-07-11 19:19   ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140711191747.GF9775@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=kinglongmee@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox