From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Martin Doucha <mdoucha@suse.cz>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH 3/3] quotactl06: Fix TESTDIR1 cleanup if setup() exits early
Date: Fri, 4 Mar 2022 10:00:33 +0000 [thread overview]
Message-ID: <6221E366.8000304@fujitsu.com> (raw)
In-Reply-To: <7b039478-a14a-809f-7499-4f760a611093@suse.cz>
Hi Martin
> On 04. 03. 22 2:38, xuyang2018.jy@fujitsu.com wrote:
>> Hi Martin
>>> When setup() exits with TCONF before TESTDIR1 gets created, cleanup() will
>>> trigger TWARN when it tries to delete it. Check whether the directory exists
>>> before calling SAFE_RMDIR().
>>>
>>> Signed-off-by: Martin Doucha<mdoucha@suse.cz>
>>> ---
>>> testcases/kernel/syscalls/quotactl/quotactl06.c | 4 +++-
>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
>>> index 8e9a17393..d470486d5 100644
>>> --- a/testcases/kernel/syscalls/quotactl/quotactl06.c
>>> +++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
>>> @@ -207,7 +207,9 @@ static void setup(void)
>>> static void cleanup(void)
>>> {
>>> SAFE_UNLINK(USRPATH);
>> It seems we also should check USRPATH whether existed.
>
> If I understand correctly, the file will be created by mount(), even
> before setup() gets executed. So if the file doesn't exist during
> cleanup(), the error will be valid.
The USRPATH file is generated by quotacheck command.
Best Regards
Yang Xu
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-03-04 10:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 15:31 [LTP] [PATCH 1/3] quotactl06: Replace tst_brk(TFAIL) with TBROK Martin Doucha
2022-03-03 15:31 ` [LTP] [PATCH 2/3] quotactl06: Code style fixes Martin Doucha
2022-03-04 1:36 ` xuyang2018.jy
2022-03-03 15:31 ` [LTP] [PATCH 3/3] quotactl06: Fix TESTDIR1 cleanup if setup() exits early Martin Doucha
2022-03-04 1:38 ` xuyang2018.jy
2022-03-04 9:24 ` Martin Doucha
2022-03-04 10:00 ` xuyang2018.jy [this message]
2022-03-04 1:35 ` [LTP] [PATCH 1/3] quotactl06: Replace tst_brk(TFAIL) with TBROK xuyang2018.jy
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=6221E366.8000304@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.