Messages in this thread | | | Date | Fri, 8 Nov 2013 10:34:55 +0100 | From | Jiri Olsa <> | Subject | Re: [PATCH 2/2] perf record: mmap output file - v4 |
| |
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
| |