FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-03-2009, 07:44 AM
Hans de Goede
 
Default PATCH: do not run multipath stuff when not nescessary

Hi,

While working on dmraid I noticed that the multipath stuff gets run when it
shouldn't, this is because the test changed in the patch below assumes that not
has a lower precedence then and, which it has not, so the not only applies to
one part of the and, making the test wrong.


diff --git a/partedUtils.py b/partedUtils.py
index 2fc553c..cf18324 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -584,7 +584,7 @@ class DiskSet:
def startMPath(self):
"""Start all of the dm multipath devices associated with the DiskSet."""

- if not DiskSet.mpList is None and DiskSet.mpList.__len__() > 0:
+ if DiskSet.mpList is None or DiskSet.mpList.__len__() == 0:
return

log.debug("starting mpaths")

Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-03-2009, 02:33 PM
Jeremy Katz
 
Default PATCH: do not run multipath stuff when not nescessary

On Tuesday, February 03 2009, Hans de Goede said:
> While working on dmraid I noticed that the multipath stuff gets run when
> it shouldn't, this is because the test changed in the patch below assumes
> that not has a lower precedence then and, which it has not, so the not
> only applies to one part of the and, making the test wrong.

We don't want to return immediately if mpList is None, though -- that means
that we haven't been through startMpath() before and thus haven't set
things up. Maybe more clear would be

> diff --git a/partedUtils.py b/partedUtils.py
> index 2fc553c..cf18324 100644
> --- a/partedUtils.py
> +++ b/partedUtils.py
> @@ -584,7 +584,7 @@ class DiskSet:
> def startMPath(self):
> """Start all of the dm multipath devices associated with the DiskSet."""
>
> - if not DiskSet.mpList is None and DiskSet.mpList.__len__() > 0:
> + if DiskSet.mpList is None or DiskSet.mpList.__len__() == 0:
+ if DiskSet.mpList is not None and DiskSet.mpList.__len__() > 0:
> return
>
> log.debug("starting mpaths")

Jeremy

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-06-2009, 08:33 AM
Hans de Goede
 
Default PATCH: do not run multipath stuff when not nescessary

Jeremy Katz wrote:

On Tuesday, February 03 2009, Hans de Goede said:
While working on dmraid I noticed that the multipath stuff gets run when
it shouldn't, this is because the test changed in the patch below assumes
that not has a lower precedence then and, which it has not, so the not
only applies to one part of the and, making the test wrong.


We don't want to return immediately if mpList is None, though -- that means
that we haven't been through startMpath() before and thus haven't set
things up. Maybe more clear would be




Ah, ok so I misunderstood the purpose of the check, in that case never mind it
is fine as is.


Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org