Ayal Baron has posted comments on this change.
Change subject: Invalidate filters on HSMs before rescanning extended VG ......................................................................
Patch Set 18:
This talk about a race is simply incorrect. There is NO race here, not small, nor big.
There are 2 ways in lvm.py that a filter is created: 1. when you call cmd without any list of devices. In this case the filter you will get will include *all* visible devices on the system, regardless of whether they belong to any VG or not. In such calls, invalidating the filter after calling getDevicesVisibility is the correct behaviour and there is no race (the filter *will* contain the new devices whether the vg has already been extended or not.
2. when you call cmd with a specific list of devices. In this case a filter is created based solely on this list and _filterStale is skipped entirely so again, no race.
The only question is when and how the list of devices that are associated with the VG would get updated [1] and that is taken care of irrespective of this patch
[1] so that calls to cmd with short filter would be with full list of devices