[NEW PATCH] BZ#720911 - Update lvm cache filter when an lvm command fails (via gerrit-bot)

Saggi Mizrahi smizrahi at redhat.com
Mon Jul 25 10:20:08 UTC 2011


New patch submitted by Saggi Mizrahi (smizrahi at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/698

commit 9ad01c656a6fee247a24a6b849796ff284317a22
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date:   Sun Jul 24 19:04:58 2011 +0300

    BZ#720911 - Update lvm cache filter when an lvm command fails
    
    Change-Id: I375a6407782a0cb1d3fe61b2c5f437ea6ecfe9fb

diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index c1d285b..55e790e 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -367,8 +367,20 @@ class LVMCache(object):
         self._bootstrap()
 
     def cmd(self, cmd):
-        cmd = self._addExtraCfg(cmd)
-        return misc.execCmd(cmd)
+        finalCmd = self._addExtraCfg(cmd)
+        rc, out, err = misc.execCmd(finalCmd)
+        if rc != 0:
+            #Filter might be stale
+            self.invalidateFilter()
+            newCmd = self._addExtraCfg(cmd)
+            # Before blindly trying again make sure
+            # that the commands are not identical, because
+            # the devlist is sorted there is no fear
+            # of two identical filters looking differently
+            if newCmd != finalCmd:
+                return misc.execCmd(newCmd)
+
+        return rc, out, err
 
 
     def __str__(self):
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py
index 245c5bf..67c9302 100644
--- a/vdsm/storage/sdc.py
+++ b/vdsm/storage/sdc.py
@@ -39,11 +39,11 @@ class StorageDomainCache:
 
     def invalidateStorage(self):
         self.storageStale = True
+        lvm.invalidateFilter()
 
     @misc.samplingmethod
     def refreshStorage(self):
         multipath.rescan()
-        lvm.updateLvmConf()
         lvm.getAllVGs()
         self.storageStale = False
 




More information about the vdsm-patches mailing list