Nir Soffer has posted comments on this change.
Change subject: Invalidate filters on HSMs before rescanning extended VG ......................................................................
Patch Set 16: Code-Review-1
(2 comments)
Looks good, but I think it can more correct.
.................................................... File vdsm/storage/hsm.py Line 1985: def scanDevicesVisibility(self, guids): Line 1986: visible = lambda guid: (guid, os.path.exists( Line 1987: os.path.join("/dev/mapper", guid))) Line 1988: visibleDevs = map(visible, guids) Line 1989: if not all(visibleDevs): This seems to be the correct way to invalidate the filters - we found a device which is not visible.
Can you validate this? Line 1990: multipath.rescan() Line 1991: visibleDevs = map(visible, guids) Line 1992: return dict(visibleDevs) Line 1993:
Line 2004: boolean Line 2005: :rtype: dict Line 2006: """ Line 2007: visibility = self.scanDevicesVisibility(guids) Line 2008: lvm.invalidateFilter() I suspect that this is not the most correct way to invalidate the filter. If all guids are visible, the filters are probably correct as well.
If we choose to invalidate the filters here anyway, it should be done either before calling scanDevicesVisibility, or after processing visibility dict. Not sure why you chose to insert the call in the middle of the existing code. Line 2009: for guid in guids: Line 2010: if visibility[guid]: Line 2011: visibility[guid] = (os.stat('/dev/mapper/' + guid).st_mode & Line 2012: stat.S_IRUSR != 0)