[LTP] [PATCH] tst_umount: Retry open() after umount to handle delayed device release
Cyril Hrubis
chrubis@suse.cz
Wed Aug 6 11:27:23 CEST 2025
Hi!
> Currently, tst_umount() in lib/tst_device.c tries to repeatedly umount()
> a mount point, with a retry loop if it gets EBUSY. However, after umount()
> reports success, devices (especially loop devices) can still be held open
> by another process or kernel, delaying their actual release. This can lead
> to race conditions when the next operation tries to reuse the device like
> mkfs.ext3 error:
This looks like working around a kernel bug to me. The umount() without
MNT_DETACH should make the device reusable once the syscall returns back
to the userspace. At least I wouldn't add this code to LTP unless kernel
devs tells us that this broken behavior is to be expected.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list