Change in vdsm[master]: storageServer: Normalize local path before escaping

danken at redhat.com danken at redhat.com
Fri Feb 5 20:13:46 UTC 2016


Dan Kenigsberg has submitted this change and it was merged.

Change subject: storageServer: Normalize local path before escaping
......................................................................


storageServer: Normalize local path before escaping

Hosted engine setup does not normalize mount path, so hosted engine
storage domain with trailing slash:

    /foo/

will be mounted at:

    /rhev/data-center/mnt/_foo_

This is harmless until hosted engine try to import the hosted engine
storage domain, recreating the storage domain path from the storage
domain information, returning a normalized remote path. After importing
the domain, the host will have the same remote path mounted twice at
two different local paths:

    /rhev/data-center/mnt/_foo
    /rhev/data-center/mnt/_foo_

Mounting the same domain twice does not work, leading to failure.

Storage domains created in engine do not have this issue since engine
does not allow path with trailing slash.

We are normalizing mount remote and local path, both before mount, and
when reading mount information from /proc/mounts and /etc/mtab.
However, we were escaping slashes in the normal path *before*
normalizing it, so the normalization had no effect.

This patch normalize the local path before escaping slashes, to match
the intent of the original code, and avoid such issues in the future.

This change does not fix hosted engine system with unnormalized local
path. The only way to fix this is to disconnect the storage domain and
connect it again with a normalized path.

Change-Id: I4db1fb7dfe4627442f87502563a578bb1f184c1e
Bug-Url: https://bugzilla.redhat.com/1300749
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/52873
Continuous-Integration: Jenkins CI
Reviewed-by: Roy Golan <rgolan at redhat.com>
Reviewed-by: Martin Sivák <msivak at redhat.com>
Reviewed-by: Simone Tiraboschi <stirabos at redhat.com>
Reviewed-by: Sandro Bonazzola <sbonazzo at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/storageServerTests.py
M vdsm/storage/storageServer.py
2 files changed, 16 insertions(+), 1 deletion(-)

Approvals:
  Sandro Bonazzola: Looks good to me, but someone else must approve
  Nir Soffer: Verified
  Martin Sivák: Looks good to me, but someone else must approve
  Simone Tiraboschi: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Roy Golan: Looks good to me, but someone else must approve



-- 
To view, visit https://gerrit.ovirt.org/52873
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4db1fb7dfe4627442f87502563a578bb1f184c1e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo at redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stirabos at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list