Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Wei Gao" <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v13] fsconfig04: Check FSCONFIG_SET_PATH
Date: Fri, 04 Sep 2026 12:51:58 +0000	[thread overview]
Message-ID: <6a9abeef.14e24f9c.2590a.fec3@mx.google.com> (raw)
In-Reply-To: <20260813052853.22152-1-wegao@suse.com>

Hi Wei,

> +#define MNTPOINT	"mntpoint"

this is never used

> +#define LOOP_DEV_SIZE 10
> +#define UUID "d73c9e5e-97e4-4a9c-b17e-75a931b02660"
> +
> +static int fd = -1;
> +static char dev0[PATH_MAX];

the static dev0 buffer and strcpy() are redundant since tst_device->dev is
already available

> +static char dev1[PATH_MAX];
> +static char dev2[PATH_MAX];
> +
> +static char device_option_dev1[PATH_MAX + 16];
> +static char device_option_dev2[PATH_MAX + 16];
> +static const char *const mkfs_opts_journal_dev1[] = {"-F", "-J", device_option_dev1, NULL};
> +static const char *const mkfs_opts_journal_dev2[] = {"-F", "-J", device_option_dev2, NULL};
> +static const char *const mkfs_opts_set_UUID[] = {"-F", "-U", UUID, "-O", "journal_dev", NULL};

these static buffers and option arrays can be replaced with a small helper
function that formats -J device=%s locally, eliminating global mutable
state and setup() string formatting.

> +	if (found)
> +		tst_res(TPASS, "Device found in journal");
> +	else
> +		tst_res(TFAIL, "Device not found in journal");

the manual if/else result reporting can also be simplified with
TST_EXP_EXPR(found, ...)

> +
> +	pclose(tune2fs);
> +	SAFE_CLOSE(fd);

SAFE_CLOSE(fd) can be called immediately after FSCONFIG_CMD_CREATE,
freeing the kernel filesystem context before invoking tune2fs

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

  parent reply	other threads:[~2026-09-04 12:52 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 15:10 [LTP] [PATCH v1] fsconfig04.c: Check FSCONFIG_SET_PATH Wei Gao via ltp
2025-05-22 20:56 ` Petr Vorel
2025-05-26 14:29   ` Wei Gao via ltp
2025-05-26  6:40     ` Petr Vorel
2025-05-26 14:35 ` [LTP] [PATCH v2] " Wei Gao via ltp
2025-05-26  9:54   ` Petr Vorel
2025-05-26 12:54     ` Cyril Hrubis
2025-05-26 16:13       ` Petr Vorel
2025-05-27  8:24         ` Cyril Hrubis
2025-05-27  8:58           ` [LTP] LTP doc: test examples [was: Re: [PATCH v2] fsconfig04.c: Check FSCONFIG_SET_PATH] Petr Vorel
2025-05-26 14:38   ` [LTP] [PATCH v2] fsconfig04.c: Check FSCONFIG_SET_PATH Cyril Hrubis
2025-06-03 21:45   ` [LTP] [PATCH v3] " Wei Gao via ltp
2025-10-17  4:39     ` Wei Gao via ltp
2025-12-12  9:29     ` Andrea Cervesato via ltp
2026-02-25  9:27       ` Wei Gao via ltp
2026-03-16  8:49         ` Petr Vorel
2026-03-17  0:59           ` Wei Gao via ltp
2026-03-24 12:50           ` Petr Vorel
2026-04-10  5:47     ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-04-16 11:25       ` [LTP] [PATCH v5] fsconfig04: " Wei Gao via ltp
2026-04-16 13:52         ` [LTP] " linuxtestproject.agent
2026-04-16 13:55           ` Andrea Cervesato via ltp
2026-04-30  5:19         ` [LTP] [PATCH v6] " Wei Gao via ltp
2026-04-30  6:34           ` [LTP] " linuxtestproject.agent
2026-05-07 12:25             ` Wei Gao via ltp
2026-06-09  9:44           ` [LTP] [PATCH v6] " Andrea Cervesato via ltp
2026-06-10  5:21           ` [LTP] [PATCH v7] " Wei Gao via ltp
2026-06-10 10:06             ` [LTP] " linuxtestproject.agent
2026-06-18  2:38             ` [LTP] [PATCH v8] " Wei Gao via ltp
2026-06-18  4:04               ` [LTP] " linuxtestproject.agent
2026-06-26  6:14               ` [LTP] [PATCH v9] " Wei Gao via ltp
2026-06-26  9:33                 ` [LTP] " linuxtestproject.agent
2026-07-13 12:08                 ` [LTP] [PATCH v9] " Andrea Cervesato via ltp
2026-07-20 12:26                 ` [LTP] [PATCH v10] " Wei Gao via ltp
2026-07-20 13:11                   ` [LTP] " linuxtestproject.agent
2026-08-03  2:12                   ` [LTP] [PATCH v11] " Wei Gao via ltp
2026-08-03  3:37                     ` [LTP] " linuxtestproject.agent
2026-08-04  1:04                     ` [LTP] [PATCH v12] " Wei Gao via ltp
2026-08-04  4:17                       ` [LTP] " linuxtestproject.agent
2026-08-05  3:11                         ` Wei Gao via ltp
2026-08-11  7:44                           ` Andrea Cervesato via ltp
2026-08-06 11:30                       ` [LTP] [PATCH v12] " Petr Vorel
2026-08-13  5:28                       ` [LTP] [PATCH v13] " Wei Gao via ltp
2026-08-13  6:19                         ` [LTP] " linuxtestproject.agent
2026-09-04 12:51                         ` Andrea Cervesato via ltp [this message]
2026-09-09  3:20                           ` [LTP] [PATCH v13] " Wei Gao via ltp
2026-09-09  3:34                         ` [LTP] [PATCH v14] " Wei Gao via ltp
2026-09-09  8:00                           ` [LTP] " linuxtestproject.agent
2026-09-09 10:03                           ` [LTP] [PATCH v15] " Wei Gao via ltp
2026-09-09 10:34                             ` [LTP] " linuxtestproject.agent

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=6a9abeef.14e24f9c.2590a.fec3@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=wegao@suse.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