Bug 204206 - [RHEL5 Alpha] device-mapper: unused maps remain after 'dmsetup remove_all'.
[RHEL5 Alpha] device-mapper: unused maps remain after 'dmsetup remove_all'.
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: device-mapper (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Depends On:
  Show dependency treegraph
Reported: 2006-08-26 16:35 EDT by Kiyoshi Ueda
Modified: 2013-04-02 19:51 EDT (History)
10 users (show)

See Also:
Fixed In Version: RHEL5.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-24 10:17:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test script (1.42 KB, text/plain)
2006-08-26 16:35 EDT, Kiyoshi Ueda
no flags Details

  None (edit)
Description Kiyoshi Ueda 2006-08-26 16:35:45 EDT
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:

How reproducible:

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: 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 16:35:45 EDT
Created attachment 134986 [details]
Test script
Comment 2 Alasdair Kergon 2006-08-30 16:57:23 EDT
Again, try this one with udev disabled.
Comment 3 Jun'ichi NOMURA 2006-08-31 12:53:55 EDT
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 15:06:52 EST
Though I tried by using the test script for a week,
I can't reproduce this problem in:

Are any fixes included in?
Comment 5 Kiyoshi Ueda 2007-08-24 10:17:16 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.