public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: David Disseldorp <ddiss@suse.de>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 2/2] common: remove tmp.mkfs[err/std] files by name
Date: Fri, 30 Jun 2017 12:18:06 +0800	[thread overview]
Message-ID: <20170630041806.GY23360@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20170627115522.0259323d@suse.de>

On Tue, Jun 27, 2017 at 11:55:22AM +0200, David Disseldorp wrote:
> On Tue, 27 Jun 2017 12:33:04 +0800, Eryu Guan wrote:
> 
> > I posted a patch back in Jan. to cleanup tmp files and other leftover
> > files after test, I switched from mktemp to a normal "tmp=/tmp/$$._mkfs"
> > assignment so it could avoid this problem you want to fix too. But my
> > patch got no review.
> > 
> > I'm going to send new version of my patch and will fix _scratch_do_mkfs
> > too, I really appreciate if you could help review and provide
> > Reviewed-by tag.
> 
> Thanks for the feedback, Eryu. My preference would be to continue to use
> mktemp. I know it's test code, but I'd still like to avoid any potential
> symlink races.
> 
> Cheers, David

mktemp doesn't really help in this case. What we do in _scratch_do_mkfs
is like:

	local tmp=`mktemp`
	....
	eval "$mkfs_cmd ..." > $tmp.mkfsstd

$tmp is not used directly as a tmp file, it just serves as a common
prefix, $tmp._any_suffix_ can be a symlink too. (BTW, remove only
$tmp.mkfsstd and $tmp.mkfserr leaves $tmp itself in /tmp).

And I don't think it's that necessary to avoid potential symlink races
in fstests, the "tmp=/tmp/$$ then write to $tmp.file" usage is almost
everywhere in fstests. I agree it'd be great to avoid symlink races, but
IMHO it's not worth the effort to make whole fstests symlink-race-free.

Thanks,
Eryu

      reply	other threads:[~2017-06-30  4:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 13:40 [PATCH 1/2] README: remove incorrect check -udf usage David Disseldorp
2017-06-26 13:40 ` [PATCH 2/2] common: remove tmp.mkfs[err/std] files by name David Disseldorp
2017-06-27  4:33   ` Eryu Guan
2017-06-27  9:55     ` David Disseldorp
2017-06-30  4:18       ` Eryu Guan [this message]

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=20170630041806.GY23360@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=ddiss@suse.de \
    --cc=fstests@vger.kernel.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