Description of problem: After 'dmsetup remove_all' is executed in an environment that many maps exist, some maps remain even though those maps aren't used. Version-Release number of selected component: device-mapper-1.02.09-1.0.RHEL5 kernel-2.6.17-1.2519.4.5.el5 How reproducible: Rare Steps to Reproduce: 1. umount and deactivate all device-mapper devices. (e.g. LVM2 volume, dmraid devices, dm-multipath devices.) 2. Run attached script. # ./dmsetup-remove-all-fail.sh The attached script do the following: o Create a file and setup a loop-back device by using the file o Repeat 100 linear maps creation with using the loop-back device, 'sleep 3' and 'dmsetup remove_all'. o The test stops when the problem occurs or after 1000 trials. Actual results: The script stops with 'Exit test.' message below. At the time, some maps remain even though those maps aren't used and 'device-mapper: ioctl: remove_all left 1 open device(s)' message is output in the system console. -------------------------------------------------------------------- [root@nec-em8 ~]# ./dmsetup-remove-all-fail.sh INFO: Creating a file for loop setup. file=tmpfile 100+0 records in 100+0 records out 51200 bytes (51 kB) copied, 0.00155528 seconds, 32.9 MB/s INFO: Setting up loop device. dev=/dev/loop0 file=tmpfile INFO: Start map create/remove testing. INFO: Test stops when a problem occurs or after 1000 trials. INFO: Start TRIAL 0 INFO: Creating linear maps. nr_map=100 INFO: Removing all maps. ERROR: The problem occurs. Exit test. INFO: Manual clean-up is needed. [root@nec-em8 ~]# [root@nec-em8 ~]# dmsetup ls testmap13 (253, 13) [root@nec-em8 ~]# -------------------------------------------------------------------- Expected results: The script finishes with 'INFO: Test finished with no problem.' message. Additional info: The remaining map(s) can be removed by 'dmsetup remove' or 'dmsetup remove_all' again. This problem doesn't occur in RHEL4 U4. This problem seems not occurring in a few maps environment. Another problem below occurs rarely instead of the problem above. o all maps are removed o all devices are removed from /dev/mapper/ o but sysfs entry remains in /sys/block/ Attached script detects this problem too and stops.
Created attachment 134986 [details] Test script
Again, try this one with udev disabled.
When udev is disabled, the problem didn't happen after 2000 trials. (While it's rare, it usually occurs after a few hundreds trials in udev enabled case.)
Though I tried by using the test script for a week, I can't reproduce this problem in: kernel-2.6.18-1.2732.el5 device-mapper-1.02.12-2.el5 lvm2-2.02.12-3.el5 udev-095-14 Are any fixes included in?
I close this bugzilla because I can't reproduce this bug on RHEL5.0. If I found this bug still exists, I would reopen this bugzilla.