xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, ross.lagerwall@citrix.com,
	dave@recoil.org
Subject: Re: [PATCH v4 2/4] tools: split out xenstored starting form xencommons
Date: Tue, 2 Aug 2016 12:39:56 +0100	[thread overview]
Message-ID: <20160802113956.GH22419@citrix.com> (raw)
In-Reply-To: <3ae636d7-bf9a-aa0b-63c5-61946f2af47f@suse.com>

On Tue, Aug 02, 2016 at 01:20:40PM +0200, Juergen Gross wrote:
> On 02/08/16 13:13, Wei Liu wrote:
> > On Tue, Aug 02, 2016 at 12:39:26PM +0200, Juergen Gross wrote:
> >> In order to prepare starting a xenstore domain split out the starting
> >> of the xenstore daemon from the xencommons script into a dedicated
> >> launch-xenstore script.
> >>
> >> Correct one error: don't remove old tdb files in background, as this
> >> could lead to very subtle races.
> >>
> > 
> > Sorry to only notice this now -- I suppose this shouldn't be in commit
> > message because it is a changelog for different revision of your patch,
> > or you need to describe what the race is if there is really such issue
> > -- and that's a potential backport candidate.
> 
> -		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
> ...
> +	rm -f "$XENSTORED_ROOTDIR"/tdb* 2>/dev/null
> 
> Please note the "&" in the removed line. And the description just tells
> you that: the file shouldn't be removed in the background. How else
> would you describe it?
> 
> And the race should be obvious: removing a file in the background which
> is going to be used by the next command is racy.
> 
> > As far as I can tell this is pure code motion and shouldn't have any
> > change in behaviour. Hence this line in commit message makes me feel a
> > bit confused.
> 
> Still confused?

Ah, the 2> vs &> thing is really subtle. I missed that, sorry.

I think you need to separate that one change out so that we can backport
it to stable releases to avoid the race.

Wei.

> 
> 
> Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-02 11:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 10:39 [PATCH v4 0/4] tools: make xenstore domain/daemon configurable Juergen Gross
2016-08-02 10:39 ` [PATCH v4 1/4] tools: remove systemd xenstore socket definitions Juergen Gross
2016-08-02 11:07   ` Wei Liu
2016-08-02 19:45     ` David Scott
2016-08-02 10:39 ` [PATCH v4 2/4] tools: split out xenstored starting form xencommons Juergen Gross
2016-08-02 11:13   ` Wei Liu
2016-08-02 11:20     ` Juergen Gross
2016-08-02 11:39       ` Wei Liu [this message]
2016-08-02 13:48         ` Ian Jackson
2016-08-02 14:00           ` Wei Liu
2016-08-02 11:59       ` Olaf Hering
2016-08-02 12:08         ` Juergen Gross
2016-08-02 13:49         ` Ian Jackson
2016-08-02 10:39 ` [PATCH v4 3/4] tools: use pidfile for test if xenstored is running Juergen Gross
2016-08-02 11:14   ` Wei Liu
2016-08-02 10:39 ` [PATCH v4 4/4] tools: make xenstore domain easy configurable Juergen Gross
2016-08-02 11:14   ` Wei Liu

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=20160802113956.GH22419@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dave@recoil.org \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).