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

nsoffer at redhat.com nsoffer at redhat.com
Sat May 3 13:34:27 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: storage: check if mount specification is a symlink
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/27321/1/vdsm/storage/mount.py
File vdsm/storage/mount.py:

Line 264:         for record in _iterMountRecords():
Line 265:             realSpec = self.fs_spec
Line 266:             # if this is a symlink we need the real path
Line 267:             # to check against /proc/mounts
Line 268:             if os.path.lexists(realSpec):
Your comment contradict the code; lexists is not a check for symlink, but a check that the path exists (without resolving symlinks). If you like to detect a symlink, you should use islink().

    if os.path.islink(realSpec):
        realSpec = os.path.realpath(self.fs_spec)
Line 269:                 realSpec = os.path.realpath(self.fs_spec)
Line 270:             if (record.fs_spec == realSpec and
Line 271:                     record.fs_file == self.fs_file):
Line 272:                 return record


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I32aa019b52c28377c064966684986d20414df6db
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Enrico Tagliavini <enrico.tagliavini at gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list