public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: xiaoshoukui <xiaoshoukui@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1 1/1] Add ioctl_loop08 test for LOOP_GET_STATUS lock imbalance
Date: Fri, 10 Feb 2023 11:46:47 +0100	[thread overview]
Message-ID: <Y+YglzySGK8ts8y3@rei> (raw)
In-Reply-To: <20230210084408.8360-1-xiaoshoukui@gmail.com>

Hi!
> +static void verify_ioctl_loop(void)
> +{
> +	struct tcase *tc = &tcases[0];
> +	pthread_t th1, th2;
> +
> +	pthread_create(&th1, NULL, ioctl_thread, tc);
> +	usleep(500000);
> +	pthread_create(&th2, NULL, ioctl_thread, tc + 1);
> +	usleep(500000);

This part looks strange, why do we run the code that calls the ioctl in
a separate thread if we are sleeping after the thread has been created
and quite likely the thread will finish before the main thread returns
from the sleep?

Why can we just call the ioctl_thread() sequentially here?

> +	if (!find_kmsg(lock_imbalance))
> +		tst_res(TFAIL, "Trigger lock imbalance");
> +	else
> +		tst_res(TPASS, "Nothing bad happened, probably");
> +}
> +
> +static struct tst_test test = {
> +	.test_all = verify_ioctl_loop,
> +	.needs_root = 1,
> +	.needs_kconfigs = (const char *[]) {
> +					    "CONFIG_LOCKDEP=y",
> +					    NULL },
> +	.tags = (const struct tst_tag[]) {
> +					  { "linux-git", "bdac616db9bb "},
> +					  {}
> +					   },
> +	.needs_drivers = (const char *const[]) {
> +						"loop",
> +						NULL }

The whitespaces here are all messed up.

> +};
> -- 
> 2.20.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-02-10 10:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  8:44 [LTP] [PATCH 1/1 1/1] Add ioctl_loop08 test for LOOP_GET_STATUS lock imbalance xiaoshoukui
2023-02-10 10:46 ` Cyril Hrubis [this message]
2023-02-10 11:42   ` xiao shoukui
2023-02-10 12:13     ` Cyril Hrubis
2023-02-13  9:35       ` xiao shoukui
2023-02-14  9:55         ` Richard Palethorpe
  -- strict thread matches above, loose matches on Subject: below --
2023-02-10  8:05 xiaoshoukui

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=Y+YglzySGK8ts8y3@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xiaoshoukui@gmail.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