public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Tom de Vries <tdevries@suse.de>
Cc: dwz@sourceware.org, jakub@redhat.com
Subject: Re: [PATCH] Clean up temporary file in hardlink mode
Date: Wed, 3 Mar 2021 23:57:29 +0100	[thread overview]
Message-ID: <20210303225729.GJ3014@wildebeest.org> (raw)
In-Reply-To: <20210302101025.GA23663@delia>

Hi Tom,

On Tue, Mar 02, 2021 at 11:10:27AM +0100, Tom de Vries wrote:
> Consider an executable file with hardlinks a.out and b.out.
> 
> When running dwz once:
> ...
> $ dwz -h a.out b.out
> ...
> a.out and b.out are updated, and remain hardlinks to the same file.
> 
> But when running dwz once more, a.out and b.out remain unchanged, and a
> temporary file b.out.#dwz#.XXXXXX is left.
> 
> This is caused by the fact that the code in function dwz that is intended to
> handle unchanged hardlinks is never triggered.  It is guarded by a
> "resa[n].res == 1" condition, but res->res is set to 0 at the end of function
> dwz, irrespective of whether the file changed or not.
> 
> Fix this by only setting res->res to 0 if the file changed.

This looks correct. This works because at the start of the dwz
function res->res is set to -1 (ignore) or 1 (unchanged) and then only
set to -2 for the hardlink case or 0 if write_dso succeeds.

> This makes test-case twice-multifile.sh fail, we'll deal with that in a
> seperate patch.

I haven't look at that patch yet, but if at all possible I would like
to get them in together. Or otherwise make the testcase skip. Having
failing tests in between commits makes things like bisecting a bit
messy (and will trigger warnings from the buildbots).

Thanks,

Mark

  reply	other threads:[~2021-03-03 22:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 10:10 Tom de Vries
2021-03-03 22:57 ` Mark Wielaard [this message]
2021-03-04  8:21   ` Tom de Vries
  -- strict thread matches above, loose matches on Subject: below --
2019-01-01  0:00 Tom de Vries
2019-01-01  0:00 ` Tom de Vries

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=20210303225729.GJ3014@wildebeest.org \
    --to=mark@klomp.org \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=tdevries@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).