[LTP] [PATCH v3 1/2] syscalls/ioctl_loop06: Using LOOP_CONFIGURE to test invalid block size

Yang Xu xuyang2018.jy@cn.fujitsu.com
Wed Jul 29 12:43:53 CEST 2020


Hi Cyril
> 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.
Agree.
> 




More information about the ltp mailing list