From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
ltp@lists.linux.it, Matthew Bobrowski <repnop@google.com>
Subject: Re: [LTP] [PATCH 4/5] syscalls/fanotify10: Mount cycle between test cases
Date: Tue, 14 Jun 2022 12:47:56 +0200 [thread overview]
Message-ID: <20220614104756.jvaaasc5vm5cm6rq@quack3.lan> (raw)
In-Reply-To: <20220613143826.1328830-5-amir73il@gmail.com>
On Mon 13-06-22 17:38:25, Amir Goldstein wrote:
> Mount cycle detects inode refcount errors and waits for all marks
> of test case to be destructed before continuing to next test case.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Looks good to me. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> .../kernel/syscalls/fanotify/fanotify10.c | 25 +++++++++++++------
> 1 file changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/fanotify/fanotify10.c b/testcases/kernel/syscalls/fanotify/fanotify10.c
> index efef25135..b9a50672d 100644
> --- a/testcases/kernel/syscalls/fanotify/fanotify10.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify10.c
> @@ -360,6 +360,17 @@ static void cleanup_fanotify_groups(void)
> }
> }
>
> +/* Flush out all pending dirty inodes and destructing marks */
> +static void mount_cycle(void)
> +{
> + if (bind_mount_created)
> + SAFE_UMOUNT(MNT2_PATH);
> + SAFE_UMOUNT(MOUNT_PATH);
> + SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type, 0, NULL);
> + SAFE_MOUNT(MOUNT_PATH, MNT2_PATH, "none", MS_BIND, NULL);
> + bind_mount_created = 1;
> +}
> +
> static void verify_event(int p, int group, struct fanotify_event_metadata *event,
> unsigned long long expected_mask)
> {
> @@ -508,6 +519,7 @@ static void test_fanotify(unsigned int n)
> }
> cleanup:
> cleanup_fanotify_groups();
> + mount_cycle();
> }
>
> static void setup(void)
> @@ -523,25 +535,24 @@ static void setup(void)
> num_classes = NUM_PRIORITIES;
> }
>
> - /* Create another bind mount at another path for generating events */
> - SAFE_MKDIR(MNT2_PATH, 0755);
> - SAFE_MOUNT(MOUNT_PATH, MNT2_PATH, "none", MS_BIND, NULL);
> - bind_mount_created = 1;
> -
> SAFE_MKDIR(DIR_PATH, 0755);
> SAFE_FILE_PRINTF(FILE_PATH, "1");
> SAFE_FILE_PRINTF(FILE2_PATH, "1");
>
> SAFE_CP(TEST_APP, FILE_EXEC_PATH);
> SAFE_CP(TEST_APP, FILE2_EXEC_PATH);
> +
> + /* Create another bind mount at another path for generating events */
> + SAFE_MKDIR(MNT2_PATH, 0755);
> + mount_cycle();
> }
>
> static void cleanup(void)
> {
> cleanup_fanotify_groups();
>
> - if (bind_mount_created && tst_umount(MNT2_PATH) < 0)
> - tst_brk(TBROK | TERRNO, "bind umount failed");
> + if (bind_mount_created)
> + SAFE_UMOUNT(MNT2_PATH);
> }
>
> static const char *const resource_files[] = {
> --
> 2.25.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-06-14 10:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 14:38 [LTP] [PATCH 0/5] Fanotify tests for FAN_MARK_EVICTABLE Amir Goldstein
2022-06-13 14:38 ` [LTP] [PATCH 1/5] syscalls/inotify12: Introduce test for inotify mask flags Amir Goldstein
2022-06-13 14:58 ` Amir Goldstein
2022-06-13 15:23 ` Petr Vorel
2022-06-13 16:03 ` Amir Goldstein
2022-06-13 16:05 ` Petr Vorel
2022-06-13 15:48 ` Petr Vorel
2022-06-14 10:19 ` Jan Kara
2022-06-14 11:28 ` Petr Vorel
2022-06-13 14:38 ` [LTP] [PATCH 2/5] syscalls/fanotify23: Introduce FAN_MARK_EVICTABLE test Amir Goldstein
2022-06-14 10:19 ` Jan Kara
2022-06-16 8:36 ` Petr Vorel
2022-06-16 8:50 ` Amir Goldstein
2022-06-16 13:28 ` Petr Vorel
2022-06-13 14:38 ` [LTP] [PATCH 3/5] syscalls/fanotify10: Watch directory that is not the mount path Amir Goldstein
2022-06-14 10:26 ` Jan Kara
2022-06-14 11:10 ` Amir Goldstein
2022-06-16 13:31 ` Petr Vorel
2022-06-16 13:46 ` Amir Goldstein
2022-06-16 16:57 ` Petr Vorel
2022-06-13 14:38 ` [LTP] [PATCH 4/5] syscalls/fanotify10: Mount cycle between test cases Amir Goldstein
2022-06-14 10:47 ` Jan Kara [this message]
2022-06-13 14:38 ` [LTP] [PATCH 5/5] syscalls/fanotify10: Add test cases for evictable ignore mark Amir Goldstein
2022-06-14 13:04 ` Jan Kara
2022-06-30 6:27 ` Jan Stancek
2022-06-30 8:20 ` Amir Goldstein
2022-07-07 12:49 ` Jan Stancek
2022-07-09 10:09 ` Amir Goldstein
2022-07-12 8:19 ` Jan Stancek
2022-08-24 15:24 ` Jan Kara
2022-08-24 18:13 ` Amir Goldstein
2022-08-25 9:33 ` Jan Kara
2022-08-25 12:53 ` Jan Stancek
2022-08-25 13:47 ` Amir Goldstein
2022-08-25 14:03 ` Jan Kara
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=20220614104756.jvaaasc5vm5cm6rq@quack3.lan \
--to=jack@suse.cz \
--cc=amir73il@gmail.com \
--cc=ltp@lists.linux.it \
--cc=repnop@google.com \
/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).