Skip to content

Commit

Permalink
Fixes 3par driver methods that were double locking
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kumartin committed Nov 1, 2012
1 parent 11a949c commit 0ee20a0
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions cinder/volume/drivers/san/hp/hp_3par_common.py
Expand Up @@ -492,7 +492,6 @@ def get_persona_type(self, volume):
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'],
Expand Down Expand Up @@ -575,11 +574,9 @@ def create_volume(self, volume, client):
'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
Expand Down Expand Up @@ -633,7 +630,6 @@ def create_cloned_volume(self, volume, src_vref, client):

return None

@lockutils.synchronized('3par', 'cinder-', True)
def delete_volume(self, volume, client):
try:
volume_name = self._get_3par_vol_name(volume['id'])
Expand All @@ -649,7 +645,6 @@ def delete_volume(self, volume, client):
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.
Expand Down Expand Up @@ -689,7 +684,6 @@ def create_volume_from_snapshot(self, volume, snapshot, client):
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))

Expand Down Expand Up @@ -728,7 +722,6 @@ def create_snapshot(self, snapshot, client):
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))

Expand Down

0 comments on commit 0ee20a0

Please sign in to comment.