From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 3/3] controllers/cpuacct: fix rmdir failures on early test abort
Date: Thu, 2 Sep 2021 18:00:38 +0200 [thread overview]
Message-ID: <YTD1Jl8USLijLL/O@pevik> (raw)
In-Reply-To: <21179557-f1d9-4129-533e-eac6bfe8684b@canonical.com>
> On 02/09/2021 10:18, Petr Vorel wrote:
> > Hi Krzysztof,
> > ...
> >> - if [ -d "$testpath/subgroup_1" ]; then
> >> - rmdir $testpath/subgroup_*
> >> + if [ "$testpath" ]; then
> >> + if [ -d "$testpath/subgroup_1" ]; then
> >> + rmdir $testpath/subgroup_*
> >> + fi
> >> + rmdir $testpath
> >> fi
> >> - rmdir $testpath
> >> -
> > LGTM, but how about use `rm -rf' instead?
> > e.g.
> > if [ "$testpath" ]; then
> > rm -rf $testpath
> > fi
> > That could simplify checks. Or is it needed to use `rmdir' to make sure there is
> > no content in the directory? I suppose check like this is needed in cleanup,
> > thus no problem to use `rm -rf'.
> It isn't the point of this patch. I don't add here rmdir - all this code
> was here before. The only thing added here is to check whether the
> "testpath" variable is set or not.
Agree.
> I think using rm -rf should work, but anyway it's a separate commit :)
Agree, I just thought in simple thing like this it could be squashed (you add
code which then will be deleted), but sure, you're right.
I'll handle the cleanup with rm (unless you send follow up patch yourself).
Kind regards,
Petr
> Best regards,
> Krzysztof
next prev parent reply other threads:[~2021-09-02 16:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 15:16 [LTP] [PATCH v5 1/3] lib: add tst_get_free_pids helper program Krzysztof Kozlowski
2021-09-01 15:16 ` [LTP] [PATCH v5 2/3] controllers/cpuacct: skip cpuacct_100_100 on small memory systems Krzysztof Kozlowski
2021-09-01 18:14 ` Cyril Hrubis
2021-09-01 18:38 ` Petr Vorel
2021-09-02 8:06 ` Krzysztof Kozlowski
2021-09-02 12:02 ` Cyril Hrubis
2021-09-01 15:16 ` [LTP] [PATCH v5 3/3] controllers/cpuacct: fix rmdir failures on early test abort Krzysztof Kozlowski
2021-09-02 8:18 ` Petr Vorel
2021-09-02 8:24 ` Krzysztof Kozlowski
2021-09-02 16:00 ` Petr Vorel [this message]
2021-09-01 18:26 ` [LTP] [PATCH v5 1/3] lib: add tst_get_free_pids helper program Petr Vorel
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=YTD1Jl8USLijLL/O@pevik \
--to=pvorel@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