netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: netdev@vger.kernel.org, olaf.kirch@oracle.com
Subject: Re: [PATCH][RFC] network splice receive v2
Date: Fri, 15 Jun 2007 13:44:40 +0400	[thread overview]
Message-ID: <20070615094440.GA26221@2ka.mipt.ru> (raw)
In-Reply-To: <20070615093429.GQ6149@kernel.dk>

On Fri, Jun 15, 2007 at 11:34:30AM +0200, Jens Axboe (jens.axboe@oracle.com) wrote:
> > Both spd->nr_pages and page_nr are equal to 1. When spd->nr_pages
> > was 2 there was only 1 free slot in pipe_buffer.
> 
> Ah duh, indeed, it is a dumb bug indeed. This should work.

Yep, this one works too.

> diff --git a/fs/splice.c b/fs/splice.c
> index 89871c6..5327cbf 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -172,6 +172,7 @@ static const struct pipe_buf_operations user_page_pipe_buf_ops = {
>  ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
>  		       struct splice_pipe_desc *spd)
>  {
> +	unsigned int spd_pages = spd->nr_pages;
>  	int ret, do_wakeup, page_nr;
>  
>  	ret = 0;
> @@ -252,7 +253,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
>  		}
>  	}
>  
> -	while (page_nr < spd->nr_pages)
> +	while (page_nr < spd_pages)
>  		spd->spd_release(spd, page_nr++);
>  
>  	return ret;
> 
> -- 
> Jens Axboe

-- 
	Evgeniy Polyakov

  reply	other threads:[~2007-06-15  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 11:59 [PATCH][RFC] network splice receive v2 Jens Axboe
2007-06-12 18:17 ` Evgeniy Polyakov
2007-06-12 18:17   ` Jens Axboe
2007-06-12 18:18     ` Jens Axboe
2007-06-13  8:01     ` Evgeniy Polyakov
2007-06-13 19:50       ` Jens Axboe
2007-06-14 11:57       ` Evgeniy Polyakov
2007-06-14 11:59         ` Jens Axboe
2007-06-15  8:06           ` Evgeniy Polyakov
2007-06-15  8:43             ` Jens Axboe
2007-06-15  9:14               ` Evgeniy Polyakov
2007-06-15  9:34                 ` Jens Axboe
2007-06-15  9:44                   ` Evgeniy Polyakov [this message]
2007-06-15 13:31                     ` Jens Axboe

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=20070615094440.GA26221@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=jens.axboe@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=olaf.kirch@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).