From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: Martin Doucha <martin.doucha@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v5 2/3] ioctl_loop01.c: Add new support .needs_cmds
Date: Tue, 11 Nov 2025 12:14:37 +0100 [thread overview]
Message-ID: <20251111111437.GB42156@pevik> (raw)
In-Reply-To: <20251110024805.31070-3-wegao@suse.com>
Hi Wei,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> @@ -78,23 +78,6 @@ static void check_loop_value(int set_flag, int get_flag, int autoclear_field)
> static void verify_ioctl_loop(void)
> {
> - int ret;
> - const char *const cmd_parted[] = {"parted", "-s", dev_path, "mklabel", "msdos", "mkpart",
> - "primary", "ext4", "1M", "10M", NULL};
> -
> - tst_fill_file("test.img", 0, 1024 * 1024, 10);
> - tst_attach_device(dev_path, "test.img");
> -
> - ret = tst_cmd(cmd_parted, NULL, NULL, TST_CMD_PASS_RETVAL);
> - if (!ret)
> - parted_sup = 1;
> - else if (ret == 255)
> - tst_res(TCONF, "parted binary not installed or failed");
> - else
> - tst_res(TCONF, "parted exited with %i", ret);
> -
> - attach_flag = 1;
> -
> TST_ASSERT_INT(partscan_path, 0);
> TST_ASSERT_INT(autoclear_path, 0);
> TST_ASSERT_STR(backing_path, backing_file_path);
> @@ -113,10 +96,23 @@ static void verify_ioctl_loop(void)
> static void setup(void)
> {
> + parted_sup = tst_cmd_present("parted");
> +
> + const char *const cmd_parted[] = {"parted", "-s", dev_path, "mklabel", "msdos", "mkpart",
> + "primary", "ext4", "1M", "10M", NULL};
FYI unfortunately I'm still able to trigger loop failure on SLES 5.14 based kernel
when looping ioctl_loop01 and ioctl_ficlone02 for a while on both current master
and with this patch (which does not handle the problem).
dmesg:
[ 1101.501003] ioctl_loop01
[ 1101.519346] loop0: detected capacity change from 0 to 20480
[ 1101.664879] loop_reread_partitions: partition scan of loop0 () failed (rc=-16)
[ 1101.705931] blk_update_request: I/O error, dev loop0, sector 20352 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[ 1101.710398] blk_update_request: I/O error, dev loop0, sector 20352 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1101.710423] __loop_clr_fd: partition scan of loop0 failed (rc=-16)
[ 1101.713612] Buffer I/O error on dev loop0p1, logical block 2288, async page read
[ 1101.774843] blk_update_request: I/O error, dev loop0, sector 20352 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[ 1101.783014] blk_update_request: I/O error, dev loop0, sector 20352 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1101.787585] Buffer I/O error on dev loop0p1, logical block 2288, async page read
[ 1101.824974] ioctl_ficlone02
[ 1101.827315] loop0: detected capacity change from 0 to 614400
[ 1101.861851] /dev/zero: Can't open blockdev
[ 1101.968916] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
[ 1101.975954] EXT4-fs (loop0): mounted filesystem without journal. Opts: (null). Quota mode: none.
[ 1102.156957] EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem
[ 1102.163452] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 1102.268502] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
Fortunately Martin is working on a patch for LTP library that'll check for
leftover partitions after loop device release and clear them, with appropriate
TWARN message.
Kind regards,
Petr
> +
> dev_num = tst_find_free_loopdev(dev_path, sizeof(dev_path));
> if (dev_num < 0)
> tst_brk(TBROK, "Failed to find free loop device");
> + tst_fill_file("test.img", 0, 1024 * 1024, 10);
> +
> + tst_attach_device(dev_path, "test.img");
> + attach_flag = 1;
> +
> + if (parted_sup)
> + SAFE_CMD(cmd_parted, NULL, NULL);
> +
> sprintf(partscan_path, "/sys/block/loop%d/loop/partscan", dev_num);
> sprintf(autoclear_path, "/sys/block/loop%d/loop/autoclear", dev_num);
> sprintf(backing_path, "/sys/block/loop%d/loop/backing_file", dev_num);
> @@ -148,5 +144,9 @@ static struct tst_test test = {
> {"linux-git", "6ac92fb5cdff"},
> {}
> },
> + .needs_cmds = (struct tst_cmd[]) {
> + {.cmd = "parted", .optional = 1},
> + {}
> + },
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-11-11 11:15 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 8:50 [LTP] [PATCH v1 0/2] new cmd support option for needs_cmds Wei Gao via ltp
2025-09-26 8:50 ` [LTP] [PATCH v1 1/2] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-09-26 9:31 ` Cyril Hrubis
2025-09-26 8:50 ` [LTP] [PATCH v1 2/2] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-09-26 9:32 ` Cyril Hrubis
2025-09-28 23:26 ` [LTP] [PATCH v1 0/2] new cmd support option for needs_cmds Wei Gao via ltp
2025-09-28 23:26 ` [LTP] [PATCH v2 1/2] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-09-30 13:36 ` Petr Vorel
2025-10-10 6:32 ` Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-10-10 9:13 ` Petr Vorel
2025-10-10 9:45 ` Petr Vorel
2025-10-10 6:45 ` [LTP] [PATCH v3 2/4] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 3/4] Update test cases use new needs_cmds Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 4/4] tst_run_shell.c: Add new function handle " Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 0/3] new cmd support option for needs_cmds Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 1/3] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-10-17 14:35 ` Petr Vorel
2025-10-20 1:22 ` Wei Gao via ltp
2025-10-20 13:21 ` Petr Vorel
2025-10-21 3:42 ` Wei Gao via ltp
2025-10-22 9:23 ` Li Wang via ltp
2025-10-22 14:19 ` Wei Gao via ltp
2025-10-17 15:37 ` Petr Vorel
2025-10-20 1:24 ` Wei Gao via ltp
2025-10-20 13:33 ` Petr Vorel
2025-10-21 3:17 ` Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 2/3] Update test cases use new needs_cmds Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 3/3] tst_run_shell.c: Add new function handle " Wei Gao via ltp
2025-10-17 15:30 ` Petr Vorel
2025-10-17 15:41 ` Petr Vorel
2025-10-20 1:41 ` Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 1/4] tst_cmd.c: Check brk_nosupp when tst_get_path failed Wei Gao via ltp
2025-11-07 10:33 ` Petr Vorel
2025-11-07 0:30 ` [LTP] [PATCH v4 2/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2025-11-07 11:04 ` Petr Vorel
2025-11-08 12:58 ` Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2025-11-07 11:41 ` Petr Vorel
2025-11-10 2:47 ` [LTP] [PATCH v5 0/3] new cmd support option for needs_cmds Wei Gao via ltp
2025-11-10 2:47 ` [LTP] [PATCH v5 1/3] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-11-11 11:06 ` Petr Vorel
2025-12-12 10:30 ` Cyril Hrubis
2025-12-12 11:16 ` Petr Vorel
2025-12-15 7:33 ` Wei Gao via ltp
2025-12-15 9:36 ` Petr Vorel
2025-12-15 10:59 ` Wei Gao via ltp
2025-12-17 13:18 ` Petr Vorel
2026-01-07 8:05 ` Petr Vorel
2025-11-10 2:47 ` [LTP] [PATCH v5 2/3] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2025-11-11 11:14 ` Petr Vorel [this message]
2025-11-10 2:47 ` [LTP] [PATCH v5 3/3] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2025-11-11 10:41 ` Wei Gao via ltp
2025-11-11 11:15 ` Petr Vorel
2025-12-23 2:08 ` [LTP] [PATCH v6 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-12-23 2:08 ` [LTP] [PATCH v6 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2026-01-05 13:48 ` Petr Vorel
2026-01-06 10:01 ` Cyril Hrubis
2025-12-23 2:08 ` [LTP] [PATCH v6 2/4] tst_test.c: Add tst_cmd_present check if a command is present Wei Gao via ltp
2026-01-05 13:52 ` Petr Vorel
2026-01-06 10:02 ` Cyril Hrubis
2026-01-07 6:16 ` Wei Gao via ltp
2026-01-07 8:09 ` Petr Vorel
2026-01-07 8:27 ` Petr Vorel
2026-01-07 9:59 ` Cyril Hrubis
2026-01-09 6:11 ` Wei Gao via ltp
2026-01-12 11:05 ` Petr Vorel
2026-01-07 9:56 ` Cyril Hrubis
2025-12-23 2:08 ` [LTP] [PATCH v6 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2026-01-05 13:56 ` Petr Vorel
2025-12-23 2:08 ` [LTP] [PATCH v6 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2026-01-05 13:57 ` Petr Vorel
2026-01-09 6:16 ` [LTP] [PATCH v7 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2026-01-09 6:16 ` [LTP] [PATCH v7 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2026-01-09 19:15 ` Petr Vorel
2026-01-09 19:21 ` Petr Vorel
2026-01-16 14:03 ` Li Wang via ltp
2026-01-19 14:51 ` Cyril Hrubis
2026-01-20 6:42 ` Petr Vorel
2026-01-09 6:16 ` [LTP] [PATCH v7 2/4] tst_test.c: Add tst_cmd_present check if a command is present Wei Gao via ltp
2026-01-09 19:17 ` Petr Vorel
2026-01-12 11:08 ` Petr Vorel
2026-01-16 13:58 ` Li Wang via ltp
2026-01-19 13:17 ` Cyril Hrubis
2026-01-09 6:16 ` [LTP] [PATCH v7 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2026-01-16 13:25 ` Li Wang via ltp
2026-01-17 13:16 ` Wei Gao via ltp
2026-01-19 3:00 ` Li Wang via ltp
2026-01-19 5:34 ` Wei Gao via ltp
2026-01-19 6:27 ` Li Wang via ltp
2026-01-19 14:57 ` Cyril Hrubis
2026-01-21 13:08 ` Cyril Hrubis
2026-01-09 6:16 ` [LTP] [PATCH v7 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2026-01-21 13:09 ` Cyril Hrubis
2026-01-21 13:11 ` Petr Vorel
2025-09-28 23:26 ` [LTP] [PATCH v2 2/2] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-09-30 13:12 ` 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=20251111111437.GB42156@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@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