[PATCH rhel6-branch] mpath: fix bug in parseMultipathOutput (#803883)

Brian C. Lane bcl at redhat.com
Mon Oct 15 18:52:38 UTC 2012


On Mon, Oct 15, 2012 at 02:46:56PM -0400, Will Woods wrote:
> parseMultipathOutput was assuming that each new mpath block would start
> with 'create: ' or 'mpath'. But sometimes we can get input like this:
> 
>   create: mpatha [...]
>     `- 2:3:0:0   sda 8:0  undef ready running
>   reject: mpathb [...]
>     `- 2:255:1:0 sdb 8:16 undef ready running
> 
> Since the regex only matched 'create: ', it missed the start of the new
> block and incorrectly puts 'sdb' into 'mpatha' with 'sda'.
> 
> Instead, match any string of lowercase letters and save that as the
> 'action'. When we hit the end of the block, if the action is 'create' or
> None (i.e. the plain 'mpath' case) it's saved, otherwise it's ignored.
> 
> (We should only ever see 'reject' and 'create' as far as I can tell, but
> better safe than sorry.)
> ---
>  storage/devicelibs/mpath.py       | 11 ++++++-----
>  tests/storage/devicelibs/mpath.py | 17 +++++++++++++++++
>  2 files changed, 23 insertions(+), 5 deletions(-)

ACK

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20121015/0995c77c/attachment.sig>


More information about the anaconda-patches mailing list