[LTP] [PATCH v4 3/4] ioctl_loop01.c: Add new support .needs_cmds

Wei Gao wegao@suse.com
Sat Nov 8 13:58:15 CET 2025


On Fri, Nov 07, 2025 at 12:04:21PM +0100, Petr Vorel wrote:
> Hi Wei,
> 
> ...
> > +++ b/testcases/kernel/syscalls/ioctl/ioctl_loop01.c
> > @@ -78,21 +78,7 @@ 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};
> > -
> ...
> >  static void setup(void)
> >  {
> > +	parted_sup = tst_cmd_present("parted");
> > +
> > +	const char *const cmd_parted[] = {"parted", "-s", "test.img", "mklabel", "msdos", "mkpart",
> > +	                                  "primary", "ext4", "1M", "10M", NULL};
> > +
> 
> dev_path => "test.img". With this you're effectively reverting your own fix from
> ba605cc955 ("ioctl_loop01.c: Use proper device for partitioning"). Why?
> 
Sorry, my mistake.
The root cause is that patchv2 was created before the date associated with commit ba605cc955,
so change base patchv2 without rebase trigger this update.
patchv2: https://patchwork.ozlabs.org/project/ltp/patch/20250928232708.24007-3-wegao@suse.com/

> 'parted' with dev_path immediately fails (haven't found why). But with your
> patch applied I'm able to trigger again the problem "TBROK: mkfs.vfat failed
> with exit code 1".
Because missing tst_attach_device for /loop/devX before execute "parted", i will fix that in next version.
tst_attach_device(dev_path, "test.img");
> 
> Kind regards,
> Petr


More information about the ltp mailing list