[LTP] [PATCH v2 1/3] umount01: Simplify test using TST_ macros
Petr Vorel
pvorel@suse.cz
Fri Oct 27 19:18:15 CEST 2023
Hi Xu,
[ Cc Cyril, who wrote gvfsd-trash note in 10b61174c ("syscalls: umount01: Give a
hint on failure with EBUSY") ]
While this patch looks to be OK, there is a problem when run several times
(either with -i > 1 or even just repeatedly run without -i):
./umount01 -i2 # your version
tst_device.c:96: TINFO: Found free device 2 '/dev/loop2'
tst_test.c:1105: TINFO: Formatting /dev/loop2 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1690: TINFO: LTP version: 20230929-83-g4123555e7
tst_test.c:1574: TINFO: Timeout per run is 0h 00m 30s
umount01.c:20: TINFO: Mounting /dev/loop2 to /tmp/LTP_umoxYOalA/mntpoint fstyp=ext2 flags=0
umount01.c:25: TFAIL: umount(MNTPOINT) failed: EBUSY (16)
umount01.c:28: TINFO: umount() Failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01.c:20: TINFO: Mounting /dev/loop2 to /tmp/LTP_umoxYOalA/mntpoint fstyp=ext2 flags=0
umount01.c:20: TBROK: mount(/dev/loop2, mntpoint, ext2, 0, (nil)) failed: EBUSY (16)
I tried to bisect and run even the several years old code (with
CFLAGS="-fcommon", so that I don't have to bother with error fixed in 9ac2ee5ac
("lib: Fix linking error multiple TCID definitions with -fno-common")) it quite
often (not always) fails:
./umount01 # 9185ace3e # (rewrite to new API)
tst_device.c:81: INFO: Found free device '/dev/loop3'
tst_test.c:754: INFO: Timeout per run is 0h 05m 00s
tst_mkfs.c:69: INFO: Formatting /dev/loop3 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
umount01.c:42: INFO: umount() Failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01.c:48: FAIL: umount() Failed: EBUSY
tst_device.c:277: INFO: umount('mntpoint') failed with EBUSY, try 1...
tst_device.c:281: INFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests.
./umount01 # 6825c4f73 (before rewrite to new API)
umount01 0 TINFO : Found free device '/dev/loop2'
umount01 0 TINFO : Formatting /dev/loop2 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
umount01 0 TINFO : umount() failed with EBUSY possibly some daemon (gvfsd-trash) is probing newly mounted dirs
umount01 1 TFAIL : umount01.c:68: umount(2) Failed while unmounting mntpoint errno = 16 : Device or resource busy
The difference is, that only with your code it not only TFAIL, but also TBROK,
which leads to left mounted filesystem (which could influence other tests). I'll
try to have look next week, this should be fixed.
Kind regards,
Petr
More information about the ltp
mailing list