Change in vdsm[master]: mount: Check if mount specification is a symlink

danken at redhat.com danken at redhat.com
Thu Jun 12 14:54:40 UTC 2014


Dan Kenigsberg has submitted this change and it was merged.

Change subject: mount: Check if mount specification is a symlink
......................................................................


mount: Check if mount specification is a symlink

If a Posix compatible file system is used as a backend for the VM images
the mount device can be a symlink. The common case is LVM. Both devices
in /dev/mapper/ and /dev/$VG/ are symlinks do /dev/dm-$N.

Currently in CentOS 6.5 when using GFS2 /proc/mounts always point to the real
device, even if a symlink has been used as argument of the mount command.
Example in my current system:

    /dev/dm-13 /rhev/data-center/mnt/_dev_mapper_vg__is5000-lv__virtstorage
    gfs2 rw,seclabel,noatime,nodiratime,hostdata=jid=0,nobarrier 0 0

In this case the check performed by the getRecord() method fails since
the record and the device in /proc/mounts are different. The former is
the symlink, the latter /dev/dm-$N.

This change checks if the record is an existing symlinks, and resolves
it before comparing the record with /proc/mounts.

On the other hand if the mount command doesn't resolve the symlink, like
when using ext4 file systems, the comparison with the original given
spec must still be performed. If either one matches the storage is
mounted.

Change-Id: I32aa019b52c28377c064966684986d20414df6db
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=888711
Signed-off-by: Enrico Tagliavini <enrico.tagliavini at gmail.com>
Reviewed-on: http://gerrit.ovirt.org/27321
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/mount.py
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Nir Soffer: Looks good to me, but someone else must approve
  Federico Simoncelli: Looks good to me, approved
  Enrico Tagliavini: Verified
  Allon Mureinik: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/27321
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I32aa019b52c28377c064966684986d20414df6db
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Enrico Tagliavini <enrico.tagliavini at gmail.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Enrico Tagliavini <enrico.tagliavini at gmail.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yoav Kleinberger <ykleinbe at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list