From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_supported_fs_types.c: Add tmpfs to filesystem whitelist
Date: Tue, 2 Mar 2021 11:43:59 +0100 [thread overview]
Message-ID: <YD4W7+BRQsnspQcj@yuki.lan> (raw)
In-Reply-To: <F3D3F6AC3820BB4C9FCA340DB5C32CB40387BFA9@dggeml511-mbs.china.huawei.com>
Hi!
> > But there is another problem there, since the code still mounts tmpfs on
> > tmpdir for a short while, which is temporary directory used by all LTP tests,
> > which may potentially break tests that runs in parallel.
>
> In general, when all_filesystems has been set to 1, the needs_tmpdir would be set to 1 and the mntpoint must has been set to some path, so the test run in /tmp/tmpxxxxxx/mntpoint and
> other LTP tests would run in another tmpdir. So it has no problem for running in parallel.
>
> I don't know if I understand it right.
The has_kernel_support() uses TMPDIR as the mount point, which is the
parent directory for all LTP tests, moreover it often points to just
"/tmp". If you mount anything over that directory, even for a short
while, the whole system will get different and empty "/tmp" which will
possibly break many things.
We may get over this with using "." instead, in a case that testcase has
created temporary directory and changed the PWD to it, but it's not that
simple either, since tst_test.c is not the only place that calls
has_kernel_support().
We have testcases/lib/tst_supported_fs.c helper as well that is used by
shell tests. This is a standalone binary that does not create a
temporary directory and should work even without TMPDIR being set, which
is the reason we have the if (!tmpdir) tmpdir = "/tmp"; check in the
has_kernel_support() function to begin with.
So all in all I guess that safest option would be to create a unique
temporary directory under TMPDIR and use it as a mount point in the
has_kernel_support() function.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2021-03-02 10:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-27 9:33 [LTP] [PATCH] lib/tst_supported_fs_types.c: Add tmpfs to filesystem whitelist zhaogongyi
2021-03-02 10:43 ` Cyril Hrubis [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-09 13:08 zhaogongyi
2021-03-09 13:01 Zhao Gongyi
2021-03-10 12:29 ` Cyril Hrubis
2021-03-12 10:46 ` Petr Vorel
2021-04-13 17:28 ` Cyril Hrubis
2021-03-04 2:14 zhaogongyi
2021-03-04 2:08 Zhao Gongyi
2021-03-08 16:11 ` Cyril Hrubis
2021-02-26 9:06 Zhao Gongyi
2021-02-26 9:54 ` Cyril Hrubis
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=YD4W7+BRQsnspQcj@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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