Skip to contentSkip to conversation

Resizing multipath maps: reload ioctl failed: Invalid argument

DISCUSSION Tore Anderson 2 participants 5 messages Aug 27, 2007 1 message not in the archive Device mapper

lore
Share & tools
lore
#0 lore raw

Hi. I'm trying to resize multipath maps, but there appears to be
something wrong with the ioctl call... I resized the "www" volume on the storage array from 25GB to 45GB, and attempted to reload it on the host, which is running 2.6.23-rc3 and multipath-tools 0.4.7. It resulted in the following:

root@atalanta:~# multipath -ll
[...]
www (3600a0b80002984ae0000179b46a687fb)
[size=25 GB][features=1 queue_if_no_path][hwhandler=1 rdac]
\_ round-robin 0 [prio=6][active]
 \_ 3:0:1:0 sdf 8:80  [active][ready]
 \_ 4:0:1:0 sdi 8:128 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 4:0:0:0 sdc 8:32  [active][ready]
 \_ 3:0:0:0 sdd 8:48  [active][ready]
root@atalanta:~# for d in sdf sdi sdc sdd; do cat /sys/block/$d/size; done
52428800
52428800
52428800
52428800
root@atalanta:~# for d in sdf sdi sdc sdd; do echo 1 > /sys/block/$d/device/rescan; done
root@atalanta:~# for d in sdf sdi sdc sdd; do cat /sys/block/$d/size; done
94371840
94371840
94371840
94371840
root@atalanta:~# multipath -v 2 -d
reload: www (3600a0b80002984ae0000179b46a687fb)
[size=45 GB][features=0][hwhandler=1 rdac]
\_ round-robin 0 [prio=0][undef]
 \_ 4:0:0:0 sdc 8:32  [active][ready]
 \_ 3:0:0:0 sdd 8:48  [active][ready]
\_ round-robin 0 [prio=6][undef]
 \_ 3:0:1:0 sdf 8:80  [active][ready]
 \_ 4:0:1:0 sdi 8:128 [active][ready]
[...]
root@atalanta:~# multipath -v 2
device-mapper: reload ioctl failed: Invalid argument
device-mapper: reload ioctl failed: Invalid argument
device-mapper: reload ioctl failed: Invalid argument
device-mapper: reload ioctl failed: Invalid argument
root@atalanta:~# dmsetup table www | sed 's/52428800/94371840/' | dmsetup reload www
device-mapper: reload ioctl failed: Invalid argument
Command failed

Ultimately I found no other way to make this work but to umount the
file system, then run "multipath -f www; multipath", which kind of defeated the point of fancy online resizing support in the file system and storage array since I need downtime to do it. Is there any other way to make online resizing work?

By the way, I think the error is happening in the kernel, due to the
following messages appearing in dmesg after the rescan and multipath steps:

sd 3:0:1:0: [sdf] 94371840 512-byte hardware sectors (48318 MB)
sd 3:0:1:0: [sdf] Write Protect is off
sd 3:0:1:0: [sdf] Mode Sense: 77 00 10 08
sd 3:0:1:0: [sdf] Write cache: enabled, read cache: enabled, supports DPO and FUA sd 4:0:1:0: [sdi] 94371840 512-byte hardware sectors (48318 MB)
sd 4:0:1:0: [sdi] Write Protect is off
sd 4:0:1:0: [sdi] Mode Sense: 77 00 10 08
sd 4:0:1:0: [sdi] Write cache: enabled, read cache: enabled, supports DPO and FUA sd 4:0:0:0: [sdc] 94371840 512-byte hardware sectors (48318 MB)
sd 4:0:0:0: [sdc] Write Protect is off
sd 4:0:0:0: [sdc] Mode Sense: 77 00 10 08
sd 4:0:0:0: [sdc] Uses READ/WRITE(6), disabling FUA
sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 3:0:0:0: [sdd] 94371840 512-byte hardware sectors (48318 MB)
sd 3:0:0:0: [sdd] Write Protect is off
sd 3:0:0:0: [sdd] Mode Sense: 77 00 10 08
sd 3:0:0:0: [sdd] Uses READ/WRITE(6), disabling FUA
sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
device-mapper: multipath rdac: using RDAC command with timeout 6000
device-mapper: table: device 8:32 too small for target
device-mapper: table: 253:3: multipath: error getting device
device-mapper: ioctl: error adding target to table
device-mapper: multipath rdac: using RDAC command with timeout 6000
device-mapper: table: device 8:32 too small for target
device-mapper: table: 253:3: multipath: error getting device
device-mapper: ioctl: error adding target to table
device-mapper: multipath rdac: using RDAC command with timeout 6000
device-mapper: table: device 8:32 too small for target
device-mapper: table: 253:3: multipath: error getting device
device-mapper: ioctl: error adding target to table
device-mapper: multipath rdac: using RDAC command with timeout 6000
device-mapper: table: device 8:32 too small for target
device-mapper: table: 253:3: multipath: error getting device
device-mapper: ioctl: error adding target to table

Regards

Signature · 1 line
Tore Anderson
#1 lore raw

Hi,

Quoted 5 lines · Tore Anderson

Hi. I'm trying to resize multipath maps, but there appears to be
something wrong with the ioctl call... I resized the "www" volume on the storage array from 25GB to 45GB, and attempted to reload it on the host, which is running 2.6.23-rc3 and multipath-tools 0.4.7. It resulted in the following:

It's due to kernel device-mapper restriction.

multipath-tools uses no_flush suspend of device-mapper device to save I/O errors in all-paths-down case.
(Without the option, device-mapper needs to flush all pending I/Os,
that will result in I/O errors if there is no working path.)

For no_flush suspend, resizing is disabled because of known dead-lock:
it requires a lock that can be kept hold until the pending I/Os are flushed.

Quoted 5 lines

Ultimately I found no other way to make this work but to umount the
file system, then run "multipath -f www; multipath", which kind of defeated the point of fancy online resizing support in the file system and storage array since I need downtime to do it. Is there any other way to make online resizing work?

A workaround for it would be using modified multipath-tools which doesn't use no_noflush.

Thanks,

Signature · 1 line
Jun'ichi Nomura, NEC Corporation of America
#2 lore raw

Hello,

* Jun'ichi Nomura

Quoted 10 lines

It's due to kernel device-mapper restriction.

multipath-tools uses no_flush suspend of device-mapper device to save I/O errors in all-paths-down case. (Without the option, device-mapper needs to flush all pending I/Os, that will result in I/O errors if there is no working path.)

For no_flush suspend, resizing is disabled because of known
dead-lock: it requires a lock that can be kept hold until the pending I/Os are flushed.

Hmm. So this deadlock is a kernel bug that (hopefully) will be fixed
in the future, so resizing can again be enabled, or is this a design limitation that it's impossible to do something about?

Can the no_flush thing be toggled online; that is, would it be
possible to alter multipath-tools so that when it attempted to resize a map, it would disable no_flush, resize it, and then re-enable it? I think a two-second window of vulnerability to all-paths-down is acceptable...

Similarily, if this no_flush option is relevant only when
features=queue_if_no_paths (at least that's the impression I get from your description of it), would it work to temporarily reload the map without this feature, resize the volume, than re-add queue_if_no_path?

Quoted 2 lines

A workaround for it would be using modified multipath-tools which doesn't use no_noflush.

I grepped for noflush and no_flush (and so on) in the multipath-tools
source code but can't really find where it is set..?

Thanks

Signature · 1 line
Tore Anderson
#3 lore raw

Hi,

Quoted 7 lines · Tore Anderson
Quoted 7 lines

It's due to kernel device-mapper restriction.

multipath-tools uses no_flush suspend of device-mapper device to save I/O errors in all-paths-down case. (Without the option, device-mapper needs to flush all pending I/Os, that will result in I/O errors if there is no working path.)

Quoted 7 lines
Quoted 3 lines

For no_flush suspend, resizing is disabled because of known
dead-lock: it requires a lock that can be kept hold until the pending I/Os are flushed.

Hmm. So this deadlock is a kernel bug that (hopefully) will be fixed
in the future, so resizing can again be enabled, or is this a design limitation that it's impossible to do something about?

IMO, it's not a design limitation and should be solved in future.

Quoted 5 lines

Can the no_flush thing be toggled online; that is, would it be
possible to alter multipath-tools so that when it attempted to resize a map, it would disable no_flush, resize it, and then re-enable it? I think a two-second window of vulnerability to all-paths-down is acceptable...

Everywhen you suspend the device, there is a possibility of all paths being down. So as far as you don't want to lose data, you have to use no_flush option.

Quoted 4 lines

Similarily, if this no_flush option is relevant only when
features=queue_if_no_paths (at least that's the impression I get from your description of it), would it work to temporarily reload the map without this feature, resize the volume, than re-add queue_if_no_path?

Current code uses 'no_flush' unconditionally.
I think it's possible to improve it to do that only when queue_if_no_path is enabled.

Quoted 5 lines
Quoted 2 lines

A workaround for it would be using modified multipath-tools which doesn't use no_noflush.

I grepped for noflush and no_flush (and so on) in the multipath-tools
source code but can't really find where it is set..?

Hmm, sorry. I misread your first message.
Since the feature is added after 0.4.7, your problem may be caused by other reason.
The call to dm_task_no_flush() is added after the release of 0.4.7. It should be in dm_simplecmd() in libmultipath/devmapper.c.

Thanks,

Signature · 1 line
Jun'ichi Nomura, NEC Corporation of America
#5 lore raw
In reply to a message not in the archive

Hi,

Quoted 11 lines · Tore Anderson
Quoted 3 lines

Current code uses 'no_flush' unconditionally.
I think it's possible to improve it to do that only when queue_if_no_path is enabled.

It certainly would be an improvement if no_flush and queue_if_no_path
could be automatically disabled in the short time it will take to reload the multipath map with an increased size. For extra safety the tool could also verify that no paths were failed before doing so, maybe. If everything is working fine it seems rather unlikely that all paths will fail and all HBA driver timeouts will expire in the second it takes to reload the multipath map.

It's not good to override a policy about queue_if_no_path, that will create a small window of data loss.
Even the small window could result in a disaster.
I meant in the previous mail that there is no need for multipath-tools to use no_flush if a user explicitly configures the device without queue_if_no_path.
Assuming that users sensitive to the system availability would set queue_if_no_path, I'm not sure how useful the improvement is.

Quoted 5 lines
Quoted 4 lines

Since the feature is added after 0.4.7, your problem may be caused by other reason.
The call to dm_task_no_flush() is added after the release of 0.4.7. It should be in dm_simplecmd() in libmultipath/devmapper.c.

Quoted 7 lines

Interesting. I sent an email titled "dm-rdac not working?" earlier
today, where I described another problem with the RDAC hwhandler that also caused I/O errors to propagate up from device-mapper into VFS, even though queue_if_no_path was in use. Is it possible, you think, that this misbehaviour was due to having loaded the multipath maps using 0.4.7 and therefore without no_flush being set? (Or in other
words: Is 0.4.8 a requirement for queue_if_no_path to work correctly?)

As far as the table is not suspended, e.g. just failing or reinstating paths, queue_if_no_path works correctly without no_flush. When the table is suspended, e.g. a path is added or removed, pending I/Os will be flushed on suspend even if queue_if_no_path is specified. That's the situation no_flush solves.

Easiest check is perhaps stracing multipath/multipathd and see what ioctls they issue. If they do DM_DEV_SUSPEND, using 0.4.8 might be a solution. If they don't, the cause is in other place.

Thanks,

Signature · 1 line
Jun'ichi Nomura, NEC Corporation of America