mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
	mingo@kernel.org, Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mike Galbraith <efault@gmx.de>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 2/2] perf record: mmap output file - v4
Date: Fri, 8 Nov 2013 10:34:55 +0100	[thread overview]
Message-ID: <20131108093455.GA1230@krava.brq.redhat.com> (raw)
In-Reply-To: <1383884605-30968-3-git-send-email-dsahern@gmail.com>

On Thu, Nov 07, 2013 at 09:23:25PM -0700, David Ahern wrote:

SNIP

>  
> +static void mmap_output_fini(struct perf_record *rec)
> +{
> +	off_t len;
> +	int fd;
> +
> +	if (!rec->mmap.use)
> +		return;
> +
> +	rec->mmap.use = false;
> +
> +	len = rec->session->header.data_offset + rec->bytes_written;
> +	fd = rec->file.fd;
> +
> +	munmap(rec->mmap.addr, rec->mmap.out_size);
> +	rec->mmap.addr = NULL;
> +
> +	if (ftruncate(fd, len) != 0)
> +		pr_err("ftruncate failed\n");

I think we should fail here and dont let the finishing
code run on probably corrupted file.

the code that process build IDs could even get stuck

jirka

  reply	other threads:[~2013-11-08  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  4:23 [PATCH 0/2] perf: " David Ahern
2013-11-08  4:23 ` [PATCH 1/2] perf record: Move existing write_output into helper function David Ahern
2013-11-12 21:55   ` [tip:perf/urgent] " tip-bot for David Ahern
2013-11-08  4:23 ` [PATCH 2/2] perf record: mmap output file - v4 David Ahern
2013-11-08  9:34   ` Jiri Olsa [this message]
2013-11-08 16:52     ` David Ahern
2013-11-11 11:29   ` Ingo Molnar
2013-11-11 14:58     ` Arnaldo Carvalho de Melo
2013-11-11 15:17       ` David Ahern
2013-11-11 20:41         ` Ingo Molnar
2013-11-11 20:44           ` David Ahern

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=20131108093455.GA1230@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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

Powered by JetHome