[LTP] [PATCH v3 1/2] syscalls/ioctl_loop06: Using LOOP_CONFIGURE to test invalid block size
Cyril Hrubis
chrubis@suse.cz
Wed Jul 29 12:07:58 CEST 2020
Hi!
> static void verify_ioctl_loop(unsigned int n)
> +{
> + if (tcases[n].ioctl_flag == LOOP_CONFIGURE)
> + TEST(ioctl(dev_fd, LOOP_CONFIGURE, &loopconfig));
> + else
> + TEST(ioctl(dev_fd, LOOP_SET_BLOCK_SIZE, *(tcases[n].setvalue)));
> +
> + if (TST_RET == 0) {
> + tst_res(TFAIL, "Set block size succeed unexpectedly");
> + if (tcases[n].ioctl_flag == LOOP_CONFIGURE)
> + TST_RETRY_FUNC(ioctl(dev_fd, LOOP_CLR_FD, 0), TST_RETVAL_EQ0);
I guess that we can use the tst_detach_device_by_fd() here as well
right?
If you agree with that change I will change this and push the patch.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list