From 0ee20a008746a83069c5465b74866f6e41731752 Mon Sep 17 00:00:00 2001 From: Kurt Martin Date: Wed, 31 Oct 2012 17:20:29 -0700 Subject: [PATCH] Fixes 3par driver methods that were double locking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There were many cases where the 3par drivers(FC and iSCSI) were double locking, e.g. we were locking in the individual driver and in ‘common’. This patch set removes all the locks in ‘common’ except the one on ‘create_cloned_volume’. The methods ’_get_volume_state’ and ‘_copy_volume’ are only called in ‘create_cloned_volume’, so those locks were removed as well. All the other methods in ‘common’ are only called by the driver which provide the lock, except ‘create_volume’ which is also called by ‘create_cloned_volume’. Change-Id: I660fbd04824bd2837e06480c8298ea5a709fc82a Fixes: bug 1175791 --- cinder/volume/drivers/san/hp/hp_3par_common.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index ea37b89f5..31bbb7db7 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -492,7 +492,6 @@ exit persona_id = persona_value.split(' ') return persona_id[0] - @lockutils.synchronized('3par', 'cinder-', True) def create_volume(self, volume, client): LOG.debug("CREATE VOLUME (%s : %s %s)" % (volume['display_name'], volume['name'], @@ -575,11 +574,9 @@ exit 'snapCPG': extras['snapCPG']} return metadata - @lockutils.synchronized('3parcopy', 'cinder-', True) def _copy_volume(self, src_name, dest_name): self._cli_run('createvvcopy -p %s %s' % (src_name, dest_name), None) - @lockutils.synchronized('3parstate', 'cinder-', True) def _get_volume_state(self, vol_name): out = self._cli_run('showvv -state %s' % vol_name, None) status = None @@ -633,7 +630,6 @@ exit return None - @lockutils.synchronized('3par', 'cinder-', True) def delete_volume(self, volume, client): try: volume_name = self._get_3par_vol_name(volume['id']) @@ -649,7 +645,6 @@ exit LOG.error(str(ex)) raise exception.CinderException(ex.get_description()) - @lockutils.synchronized('3par', 'cinder-', True) def create_volume_from_snapshot(self, volume, snapshot, client): """ Creates a volume from a snapshot. @@ -689,7 +684,6 @@ exit except hpexceptions.HTTPNotFound: raise exception.NotFound() - @lockutils.synchronized('3par', 'cinder-', True) def create_snapshot(self, snapshot, client): LOG.debug("Create Snapshot\n%s" % pprint.pformat(snapshot)) @@ -728,7 +722,6 @@ exit except hpexceptions.HTTPNotFound: raise exception.NotFound() - @lockutils.synchronized('3par', 'cinder-', True) def delete_snapshot(self, snapshot, client): LOG.debug("Delete Snapshot\n%s" % pprint.pformat(snapshot)) -- 2.45.2