From 4b136f574f465ce0fdd67299f5ed5f912bf5598b Mon Sep 17 00:00:00 2001 From: JordanP Date: Thu, 15 Jan 2015 15:42:10 +0100 Subject: [PATCH] Scality: Lock around SOFS mount to avoid a race Both cinder-volume and cinder-backup could want to mount the SOFS at the same time (during init). Related-Bug: #1410341 Change-Id: I75faa6eb283bc7c1f655cf5b051bed025af3d701 --- cinder/volume/drivers/scality.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cinder/volume/drivers/scality.py b/cinder/volume/drivers/scality.py index a16bb53db..918aefdda 100644 --- a/cinder/volume/drivers/scality.py +++ b/cinder/volume/drivers/scality.py @@ -23,6 +23,7 @@ import urllib2 from oslo.config import cfg from oslo.utils import units +from oslo_concurrency import lockutils import six.moves.urllib.parse as urlparse from cinder import exception @@ -99,6 +100,7 @@ class ScalityDriver(driver.VolumeDriver): if e.errno != errno.EEXIST: raise + @lockutils.synchronized('mount-sofs', 'cinder-sofs', external=True) def _mount_sofs(self): config = self.configuration.scality_sofs_config mount_path = self.configuration.scality_sofs_mount_point -- 2.45.2