All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwenke <martin@meltin.net>
To: dm-devel@redhat.com
Subject: RHEL 5.4 multipath doesn't handle virtio block devices
Date: Tue, 30 Mar 2010 12:16:06 +1100	[thread overview]
Message-ID: <20100330121606.54b4a50c@martins.ozlabs.org> (raw)

[Repost since subscribing - post from 2010-03-23 never made it...]

multipath in RHEL 5.4 doesn't handle virtio block devices.  It excludes
them because they use a sysfs bus that is not recognised.

Here's a patch that seems to fix this:

diff -r -u multipath-tools-0.4.7.rhel5.16.orig/libmultipath/discovery.c multipath-tools-0.4.7.rhel5.16/libmultipath/discovery.c
--- multipath-tools-0.4.7.rhel5.16.orig/libmultipath/discovery.c	2009-04-21 10:05:22.000000000 +1000
+++ multipath-tools-0.4.7.rhel5.16/libmultipath/discovery.c	2010-03-22 10:17:36.000000000 +1100
@@ -486,8 +486,6 @@
 		pp->bus = SYSFS_BUS_CCW;
 	else if (!strncmp(sdev->bus, "cciss", 5)) 
 		pp->bus = SYSFS_BUS_CCISS;
-	else
-		return 1;
 
 	sysfs_close_device(sdev);
 


The problem occurs because on line 490 of libmultipath/discovery.c
sysfs_get_bus() returns 1 (failure) if the bus type is not recognised.
The function should just fall through and return 0 (success), leaving
pp->bus set to the default value SYSFS_BUS_UNDEF.

This can be confirmed by noting that SYSFS_BUS_IDE is only ever used
once in the code (i.e. when pp->bus is set to SYSFS_BUS_IDE in
sysfs_get_bus()).  This shows that although there is no special case
code for SYSFS_BUS_IDE the rest of code works fine.  Similarly,
without a special case for SYSFS_BUS_UNDEF the rest of the code will
work fine.

To complicate the analysis very slightly, sysfs_pathinfo() does have a
special case for SYSFS_BUS_UNDEF.  However, it could be removed
because it simply returns 0 and this is the default return value of
sysfs_pathinfo()...

A quick scan of the current upstream multipath code in git seems to
suggest that it copes fine with unknown sysfs bus types and behaves as I
describe above.  In fact, the code no longer seems to have a special
case for SYSFS_BUS_IDE, which seems sensible.

I've tested the patch above on a KVM guest with virtio block devices
and it appears to work just fine.  Given that IDE (apparently) works
and the code has no special handling for it suggests that the change
should be backward compatible.  However, I don't have various pieces of
hardware handy to test with.

I'm happy to post a description of how to reproduce this if anyone is
interested.  It basically involves writing a unique ID at the beginning
each disk image, telling libvirt to create 2 devices pointing at each
image and then using a script for getuid_callout that reads the unique
IDs.  Hence, we're able to simulate multiple paths on virtio block
devices.

peace & happiness,
martin

             reply	other threads:[~2010-03-30  1:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  1:16 Martin Schwenke [this message]
2010-03-30  5:07 ` RHEL 5.4 multipath doesn't handle virtio block devices Kiyoshi Ueda
2010-03-30  6:23   ` Martin Schwenke
2010-03-30  7:16     ` Hannes Reinecke
2010-03-30  7:43       ` Martin Schwenke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100330121606.54b4a50c@martins.ozlabs.org \
    --to=martin@meltin.net \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.