[rhinstaller/blivet/pulls/274 master] Do not try to get LVM cache's size from stats for inactive LV

vpodzime installerbot-noreply at redhat.com
Wed Nov 11 08:28:18 UTC 2015


> @@ -1786,8 +1786,9 @@ def __init__(self, cached_lv, size=None, md_size=None, exists=False, fast_pvs=No
>  
>      @property
>      def size(self):
> -        if self.exists:
> -            return self.stats.size
> +        stats = self.stats

Because the ``stats`` property is not a static value, we always fetch the fresh data from LVM. It is a cheap operation since it is implemented in libblockdev by looking directly at device-mapper's data via libdevmapper, but there's no reason to do it twice in a row here.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/274#discussion_r44510820


More information about the anaconda-patches mailing list