Bug 204206

Summary: [RHEL5 Alpha] device-mapper: unused maps remain after 'dmsetup remove_all'.
Product: Red Hat Enterprise Linux 5 Reporter: Kiyoshi Ueda <kueda>
Component: device-mapperAssignee: Alasdair Kergon <agk>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: agk, coughlan, dwysocha, i-kitayama, jbrassow, jnomura, junichi.nomura, kueda, kueda, mbroz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHEL5.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-24 14:17:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test script none

Description Kiyoshi Ueda 2006-08-26 20:35:45 UTC
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.

Comment 1 Kiyoshi Ueda 2006-08-26 20:35:45 UTC
Created attachment 134986 [details]
Test script

Comment 2 Alasdair Kergon 2006-08-30 20:57:23 UTC
Again, try this one with udev disabled.

Comment 3 Jun'ichi NOMURA 2006-08-31 16:53:55 UTC
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.)


Comment 4 Kiyoshi Ueda 2006-11-03 20:06:52 UTC
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?

Comment 5 Kiyoshi Ueda 2007-08-24 14:17:16 UTC
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.