The first patch helps with bug #914898.
The second one is more interesting, if two devices are mounted to the same place, OpenLMI needs to know which mount was mounted first and which next, in order to display which fs is really visible at the mount point.
Typically, my F19 shows in /proc/mounts;
rootfs / rootfs rw 0 0 /dev/vda2 / ext4 rw,seclabel,relatime,data=ordered 0 0
OpenLMI needs to know that the later one is visible at /, while data from the first one is basically unavailable.
Jan
--- blivet/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 99faefa..848c839 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -1952,7 +1952,7 @@ class Blivet(object): if device is not None: device.format.mountpoint = mountpoint # for future mounts device.format._mountpoint = mountpoint # active mountpoint - + device.format.mountopts = options
def mountExistingSystem(fsset, rootDevice, allowDirty=None, dirtyCB=None,
The flag tells, if the mount is visible or it is replaced by another mount. Typically, on a F19 there is 'rootfs' mounted at '/' during boot, and later the real device is mounted there too. /proc/mounts then shows:
rootfs / rootfs rw 0 0 /dev/vda2 / ext4 rw,seclabel,relatime,data=ordered 0 0
The first format will have 'mountvisible = False', while the second 'mountvisible = True'.
I've checked with kernel guys, /proc/mount is always sorted properly, later entries always replace the earlier ones.
This patch is needed for OpenLMI, it should show which mount is really visible and which is overwriten by later one. --- blivet/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py index 848c839..1a52970 100644 --- a/blivet/__init__.py +++ b/blivet/__init__.py @@ -1906,7 +1906,13 @@ class Blivet(object): def getActiveMounts(self): """ Reflect active mounts in the appropriate devices' formats. """ log.info("collecting information about active mounts") - for line in open("/proc/mounts").readlines(): + visible_mountpoints = [] # list of already processed mount points + + # When two filesystems are mounted to the same mount point, + # the later entry in /proc/mounts replaces the earlier one, so let's + # process the file in reverse order and get the visible mount first + # and the replaced later. + for line in reversed(open("/proc/mounts").readlines()): try: (devspec, mountpoint, fstype, options, rest) = line.split(None, 4) @@ -1953,6 +1959,9 @@ class Blivet(object): device.format.mountpoint = mountpoint # for future mounts device.format._mountpoint = mountpoint # active mountpoint device.format.mountopts = options + device.format.mountvisible = (mountpoint + not in visible_mountpoints) + visible_mountpoints.append(mountpoint)
def mountExistingSystem(fsset, rootDevice, allowDirty=None, dirtyCB=None,
On Tue, 2013-04-23 at 16:10 +0200, Jan Safranek wrote:
The flag tells, if the mount is visible or it is replaced by another mount. Typically, on a F19 there is 'rootfs' mounted at '/' during boot, and later the real device is mounted there too. /proc/mounts then shows:
The first patch is fine, but I think I would prefer a different approach for this one that does not involve adding a new attribute/flag. How about we instead go back and unset the mountpoint for any devices that already have the same mountpoint as the current device? It would look roughly like this:
old_mnt = self.mountpoints.get(mountpoint) if old_mnt: old_mnt.format.mountpoint = None old_mnt.format._mountpoint = None
Do you think that will work for you?
On 04/23/2013 04:46 PM, David Lehman wrote:
On Tue, 2013-04-23 at 16:10 +0200, Jan Safranek wrote:
The flag tells, if the mount is visible or it is replaced by another mount. Typically, on a F19 there is 'rootfs' mounted at '/' during boot, and later the real device is mounted there too. /proc/mounts then shows:
The first patch is fine, but I think I would prefer a different approach for this one that does not involve adding a new attribute/flag. How about we instead go back and unset the mountpoint for any devices that already have the same mountpoint as the current device? It would look roughly like this:
old_mnt = self.mountpoints.get(mountpoint) if old_mnt: old_mnt.format.mountpoint = None old_mnt.format._mountpoint = None
Do you think that will work for you?
It's hiding of information. There are two filesystems mounted at one place, not one. I'll check with architects.
Jan
On 04/23/2013 05:23 PM, Jan Safranek wrote:
On 04/23/2013 04:46 PM, David Lehman wrote:
On Tue, 2013-04-23 at 16:10 +0200, Jan Safranek wrote:
The flag tells, if the mount is visible or it is replaced by another mount. Typically, on a F19 there is 'rootfs' mounted at '/' during boot, and later the real device is mounted there too. /proc/mounts then shows:
The first patch is fine, but I think I would prefer a different approach for this one that does not involve adding a new attribute/flag. How about we instead go back and unset the mountpoint for any devices that already have the same mountpoint as the current device? It would look roughly like this:
old_mnt = self.mountpoints.get(mountpoint) if old_mnt: old_mnt.format.mountpoint = None old_mnt.format._mountpoint = None
Do you think that will work for you?
It's hiding of information. There are two filesystems mounted at one place, not one. I'll check with architects.
It's enough to show only the last entry in /proc/mounts for a mount point, at least now. Your proposal above should work.
Jan
anaconda-patches@lists.fedorahosted.org