2015-12-11 14:31:31

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, 11 Dec 2015 12:09:03 +0000
Russell King <[email protected]> wrote:

> recordmcount edits the file in-place, which can cause problems when
> using ccache in hardlink mode. Arrange for recordmcount to break a
> hardlinked object.
>
> Signed-off-by: Russell King <[email protected]>
> ---
> Steven, sorry it took a while to get this out...

Should this be for stable, or is it fine to just add this to my 4.5
queue?

-- Steve

>
> scripts/recordmcount.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 698768bdc581..91705ef30402 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -211,6 +211,20 @@ static void *mmap_file(char const *fname)
> addr = umalloc(sb.st_size);
> uread(fd_map, addr, sb.st_size);
> }
> + if (sb.st_nlink != 1) {
> + /* file is hard-linked, break the hard link */
> + close(fd_map);
> + if (unlink(fname) < 0) {
> + perror(fname);
> + fail_file();
> + }
> + fd_map = open(fname, O_RDWR | O_CREAT, sb.st_mode);
> + if (fd_map < 0) {
> + perror(fname);
> + fail_file();
> + }
> + uwrite(fd_map, addr, sb.st_size);
> + }
> return addr;
> }
>


2015-12-11 14:45:56

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote:
> On Fri, 11 Dec 2015 12:09:03 +0000
> Russell King <[email protected]> wrote:
>
> > recordmcount edits the file in-place, which can cause problems when
> > using ccache in hardlink mode. Arrange for recordmcount to break a
> > hardlinked object.
> >
> > Signed-off-by: Russell King <[email protected]>
> > ---
> > Steven, sorry it took a while to get this out...
>
> Should this be for stable, or is it fine to just add this to my 4.5
> queue?

I thought you wanted to test it first - although I've been running with
this for a while now, my nightly builds have masked out the mcount
warning, and I suspect it'll take a while for ccache to purge itself
of the modified objects.

If you're happy to add a stable tag to it, then please do so.

--
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

2015-12-11 15:08:45

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, 11 Dec 2015 14:45:41 +0000
Russell King - ARM Linux <[email protected]> wrote:

> On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote:
> > On Fri, 11 Dec 2015 12:09:03 +0000
> > Russell King <[email protected]> wrote:
> >
> > > recordmcount edits the file in-place, which can cause problems when
> > > using ccache in hardlink mode. Arrange for recordmcount to break a
> > > hardlinked object.
> > >
> > > Signed-off-by: Russell King <[email protected]>
> > > ---
> > > Steven, sorry it took a while to get this out...
> >
> > Should this be for stable, or is it fine to just add this to my 4.5
> > queue?
>
> I thought you wanted to test it first - although I've been running with

You're right. I forgot I said that ;-)


> this for a while now, my nightly builds have masked out the mcount
> warning, and I suspect it'll take a while for ccache to purge itself
> of the modified objects.
>
> If you're happy to add a stable tag to it, then please do so.
>

I'm fine with you taking it too, but let me go ahead and run it through
my tests now. I'll let you know the results. Takes several hours.

Thanks,

-- Steve

2015-12-11 18:10:36

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, 11 Dec 2015 14:45:41 +0000
Russell King - ARM Linux <[email protected]> wrote:

> On Fri, Dec 11, 2015 at 09:31:25AM -0500, Steven Rostedt wrote:
> > On Fri, 11 Dec 2015 12:09:03 +0000
> > Russell King <[email protected]> wrote:
> >
> > > recordmcount edits the file in-place, which can cause problems when
> > > using ccache in hardlink mode. Arrange for recordmcount to break a
> > > hardlinked object.
> > >
> > > Signed-off-by: Russell King <[email protected]>
> > > ---
> > > Steven, sorry it took a while to get this out...
> >
> > Should this be for stable, or is it fine to just add this to my 4.5
> > queue?
>
> I thought you wanted to test it first - although I've been running with
> this for a while now, my nightly builds have masked out the mcount
> warning, and I suspect it'll take a while for ccache to purge itself
> of the modified objects.
>
> If you're happy to add a stable tag to it, then please do so.
>

I ran it through most my tests (it's still running and is at 20 of 33
tests). If there was anything wrong with this patch, I'm sure one of my
tests would have crashed by now.

Do you want to take it, or shall I?

If you want to take it, you can add my:

Reviewed-by: Steven Rostedt <[email protected]>

-- Steve

2015-12-11 18:33:44

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote:
> I ran it through most my tests (it's still running and is at 20 of 33
> tests). If there was anything wrong with this patch, I'm sure one of my
> tests would have crashed by now.

Thanks for testing.

> Do you want to take it, or shall I?

I'm easy - it probably makes more sense if take it.

--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

2015-12-11 18:51:23

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, 11 Dec 2015 18:33:27 +0000
Russell King - ARM Linux <[email protected]> wrote:

> On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote:
> > I ran it through most my tests (it's still running and is at 20 of 33
> > tests). If there was anything wrong with this patch, I'm sure one of my
> > tests would have crashed by now.
>
> Thanks for testing.
>
> > Do you want to take it, or shall I?
>
> I'm easy - it probably makes more sense if take it.
>

Heh, you got me hanging in suspense. You missed a word. Is it:

"makes more sense if *you* take it"

or

"makes more sense if *I* take it"

??

Or you could be replying to my sentence of "take it" or "shall I" in
which it would be *you* take it.

/me confused

-- Steve

2015-12-11 18:58:23

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, Dec 11, 2015 at 01:51:15PM -0500, Steven Rostedt wrote:
> On Fri, 11 Dec 2015 18:33:27 +0000
> Russell King - ARM Linux <[email protected]> wrote:
>
> > On Fri, Dec 11, 2015 at 01:10:29PM -0500, Steven Rostedt wrote:
> > > I ran it through most my tests (it's still running and is at 20 of 33
> > > tests). If there was anything wrong with this patch, I'm sure one of my
> > > tests would have crashed by now.
> >
> > Thanks for testing.
> >
> > > Do you want to take it, or shall I?
> >
> > I'm easy - it probably makes more sense if take it.
> >
>
> Heh, you got me hanging in suspense. You missed a word. Is it:
>
> "makes more sense if *you* take it"
>
> or
>
> "makes more sense if *I* take it"
>
> ??

Oops, sorry. "makes more sense if *you* take it" was what I thought I
typed!

--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

2015-12-11 19:28:48

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] scripts: recordmcount: break hardlinks

On Fri, 11 Dec 2015 18:58:09 +0000
Russell King - ARM Linux <[email protected]> wrote:


> Oops, sorry. "makes more sense if *you* take it" was what I thought I
> typed!
>

OK, will do.

Thanks!

-- Steve