kpartx -a: resume ioctl failed: Invalid argument
Hi all,
I have a simple testing linear DM device:
dmsetup info
Quoted 8 lines
Name: test State: ACTIVE Read Ahead: 256 Tables present: LIVE Open count: 0 Event number: 0Major, minor: 253, 0
Number of targets: 1
# Let's create a partition:
parted -s /dev/dm-0 mkpart primary ext2 0 10M
# Create devmapping with kpartx:
kpartx -v -a -p _part /dev/dm-0
Quoted 1 line
add map
test_part1(253:1): 0 19531 linear/dev/dm-01
dmsetup info test_part1
Quoted 9 lines
Name: test_part1 State: ACTIVE Read Ahead: 256 Tables present: LIVE Open count: 0 Event number: 0Major, minor: 253, 1
Number of targets: 1
UUID: part1-dm-0
# Recreate the partition with different size:
parted -s /dev/dm-0 rm 1
parted -s /dev/dm-0 mkpart primary ext2 0 20M
# Try to recreate devmappings with kpartx:
kpartx -v -a -p _part /dev/dm-0
Quoted 3 lines
device-mapper: resume ioctl failed: Invalid argument resume failed on
test_part1
add maptest_part1(253:1): 0 39062 linear/dev/dm-01
Note: the ioctl doesn't fail when kpartx is called multiple times without changing the partition table on dm-0.
It happens with current multipath-tools from git. The bug is caused by
----
commit 44b1e84d7eb72a3c03cec486a227dc1beaa9ccd6
Author: Hannes Reinecke <[email protected]> AuthorDate: Mon Feb 9 13:59:57 2009 +0100 Commit: Christophe Varoqui <[email protected]> CommitDate: Wed Apr 22 01:44:53 2009 +0200
Use noflush for kpartx
kpartx has to use 'noflush' to be able to complete for an all-paths down scenario. Otherwise no uevent might be sent and multipath will stall.
----
The patch uses --noflush with DM_DEVICE_RESUME, but as far as I understand it, --noflush makes sense only with DM_DEVICE_SUSPEND.
Perhaps kpartx should suspend the mapping before doing reload?
Signature · 8 lines
Best regards / s pozdravem Petr Uzel, Packages maintainer --------------------------------------------------------------------- SUSE LINUX, s.r.o. e-mail: [email protected] Lihovarská 1060/12 http://www.suse.cz 190 00 Prague 9 Czech Republic