[LTP] Request for Modification of test cases

Gulam Mohamed gulam.mohamed@oracle.com
Fri Jul 5 21:47:46 CEST 2024


Hi Team,

    This is regarding the change in kernel behavior about the way the loop device is detached.

              Current behavior
              -----------------------
              When the LOOP_CLR_FD ioctl command is sent to detach the loop device, the earlier behavior was that the loop     device used to be detached at that instance itself if there was a single opener only. If
               there were multiple openers of the loop device, the behavior was to defer the detach operation at the last close of the device.

              New behavior
              ------------------
              As per the new behavior, irrespective of whether there are any openers of the loop device or not, the detach operation is deferred to the last close of the device. This was done to address an issue, due
              to race coditions, recently we had in kernel.

              With the new kernel behavior in place, some of the LTP test cases in "testcases/kernel/syscalls/ioctl/" are failing as the device is closed at the end of the test and the test cases are expecting for the
               results which can occur after the device is detached. Some of the test cases which are failing are:

              1. ioctl04, ioctl05, ioctl06, ioctl07, ioctl09
              2. ioctl_loop01, ioctl_loop02, ioctl_loop03, ioctl_loop04, ioctl_loop05, ioctl_loop06, ioctl_loop07

              The main root cause of the most of the test failures, is the function "tst_detach_device_by_fd()" where the function is expecting error ENXIO which is returned only after the device is detached. But
              detach, as per new behavior, happens only after the last close (i.e after this function is returned), the test will fail with following error:

              "ioctl(/dev/loop0, LOOP_CLR_FD, 0) no ENXIO for too long"

              Similarly, some other test cases are expecting results which are returned after the detach operation, but as the detach did not happen, unexpected values are returned resulting in the test failure.

              So, can LTP maintainers team change the impacted test cases to accommodate the new behavior of kernel for the detach operation of the loop device?

Regards,
Gulam Mohamed.


More information about the ltp mailing list