All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 3/3] tracing: clean up splice code
Date: Mon, 09 Feb 2009 20:26:20 +0200	[thread overview]
Message-ID: <4990754C.7010301@cs.helsinki.fi> (raw)
In-Reply-To: <20090209182500.GA5283@localhost>

Eduard - Gabriel Munteanu wrote:
>> @@ -2573,45 +2607,25 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
>>  		ret = iter->trace->splice_read(iter, filp,
>>  					       ppos, pipe, len, flags);
>>  		if (ret)
>> -			goto out;
>> +			goto out_err;
>>  	}
>>  
>>  	ret = tracing_wait_pipe(filp);
>>  	if (ret <= 0)
>> -		goto out;
>> +		goto out_err;
>>  
>>  	if (!iter->ent && !find_next_entry_inc(iter)) {
>>  		ret = -EFAULT;
>> -		goto out;
>> +		goto out_err;
>>  	}
>>  
>>  	/* Fill as many pages as possible. */
>>  	for (i = 0, rem = len; i < PIPE_BUFFERS && rem; i++) {
>>  		pages[i] = alloc_page(GFP_KERNEL);
>> +		if (!pages[i])
>> +			break;
> 
> I believe you should decrement 'i' before breaking, since we fill
> spd.nr_pages just after the loop. In case the current page couldn't be
> allocated, spd.nr_pages will be one too many (that is, 'i').

But, but, if we fail for i == 1, for example, we want ->nr_pages == 1, no?

			Pekka

  reply	other threads:[~2009-02-09 18:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 17:28 [PATCH 0/3] git pull request for tip/tracing/ftrace Steven Rostedt
2009-02-09 17:28 ` [PATCH 1/3] tracing: splice support for tracing_pipe Steven Rostedt
2009-02-09 17:28 ` [PATCH 2/3] tracing: Move pipe waiting code out of tracing_read_pipe() Steven Rostedt
2009-02-09 17:33   ` Frederic Weisbecker
2009-02-09 17:28 ` [PATCH 3/3] tracing: clean up splice code Steven Rostedt
2009-02-09 18:25   ` Eduard - Gabriel Munteanu
2009-02-09 18:26     ` Pekka Enberg [this message]
2009-02-09 18:37       ` Eduard - Gabriel Munteanu
2009-02-09 18:43         ` Steven Rostedt
2009-02-10 13:00 ` [PATCH 0/3] git pull request for tip/tracing/ftrace Ingo Molnar
2009-02-10 14:08   ` Steven Rostedt

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=4990754C.7010301@cs.helsinki.fi \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=eduard.munteanu@linux360.ro \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.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 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.