[master 2/2] Fix mount cache resolution of devices with symlinks. (#1247803)
dwlehman
installerbot-noreply at redhat.com
Tue Aug 4 18:36:36 UTC 2015
From: David Lehman <dlehman at redhat.com>
MD and DM devices both have multiple device nodes, so resolve
everything to the canonical names.
---
blivet/mounts.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/blivet/mounts.py b/blivet/mounts.py
index 8e32220..48a6349 100644
--- a/blivet/mounts.py
+++ b/blivet/mounts.py
@@ -20,6 +20,7 @@
# Red Hat Author(s): Vojtech Trefny <vtrefny at redhat.com>
#
from collections import defaultdict
+from .udev import resolve_devspec
from . import util
from .util import open # pylint: disable=redefined-builtin
from .devicelibs import btrfs
@@ -56,7 +57,9 @@ def _getCache(self):
root = fields[3]
mountpoint = fields[4]
- devspec = fields[separator_index + 2]
+ # store the canonical device path
+ devspec = resolve_devspec(fields[separator_index + 2],
+ sysname=True)
cache[(devspec, mountpoint)] = root
return cache
@@ -73,6 +76,8 @@ def getRoot(self, devspec, mountpoint):
if self._cache is None:
self._cache = self._getCache()
+ # get the canonical device path
+ devspec = resolve_devspec(devspec, sysname=True)
return self._cache.get((devspec, mountpoint))
class MountsCache(object):
@@ -103,6 +108,9 @@ def getMountpoints(self, devspec, subvolspec=None):
if subvolspec is not None:
subvolspec = str(subvolspec)
+ # use the canonical device path
+ devspec = resolve_devspec(devspec, sysname=True)
+
return self.mountpoints[(devspec, subvolspec)]
def isMountpoint(self, path):
@@ -131,6 +139,9 @@ def _getActiveMounts(self):
log.error("failed to parse /proc/mounts line: %s", line)
continue
+ # use the canonical device path
+ devspec = resolve_devspec(devspec, sysname=True)
+
if fstype == "btrfs":
root = mountinfo.getRoot(devspec, mountpoint)
if root is not None:
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/349f9f05d448b66fd219e565a490f52771542715
More information about the anaconda-patches
mailing list