On Fri, Jun 15, 2007 at 11:34:30AM +0200, Jens Axboe ([EMAIL PROTECTED]) 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 - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html