Change in vdsm[ovirt-3.3]: hsm: Check all devices visibility after multipath rescan

nsoffer at redhat.com nsoffer at redhat.com
Sun Mar 2 13:39:20 UTC 2014


Hello Ayal Baron,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/25241

to review the following change.

Change subject: hsm: Check all devices visibility after multipath rescan
......................................................................

hsm: Check all devices visibility after multipath rescan

After invoking multipath rescan, existing devices may disapper, and
non-existing devices may appear. The orignal code was checking again
only one device after a rescan, possibly returning bogus results.

This patch check now all devices after invoking multipath.rescan().

Change-Id: I46ede1124f4c5f849b040b598b49ee784c540ecc
Relates-To: https://bugzilla.redhat.com/923773
Bug-Url: https://bugzilla.redhat.com/1066413
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21182
Reviewed-by: Ayal Baron <abaron at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/25241/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index c190879..9ab2168 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1998,15 +1998,11 @@
                 res = False
             return res
 
-        visibility = {}
-        scanned = False
-        for guid in guids:
-            visible = _isVisible(guid)
-            if not scanned and not visible:
-                multipath.rescan()
-                scanned = True
-                visible = _isVisible(guid)
-            visibility[guid] = visible
+        visibility = [_isVisible(guid) for guid in guids]
+        if not all(visibility):
+            multipath.rescan()
+            visibility = [_isVisible(guid) for guid in guids]
+        visibility = dict(zip(guids, visibility))
 
         # After multipath.rescan, existing devices may disapper, and new
         # devices may appear, making lvm filter stale.


-- 
To view, visit http://gerrit.ovirt.org/25241
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46ede1124f4c5f849b040b598b49ee784c540ecc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>


More information about the vdsm-patches mailing list