Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
NetApp: Fix race condition in 7-mode iSCSI driver with DFM.
A race condition was discovered in the driver while creating
or deleting multiple volumes in a very short interval of time
(can be reproduced by making successive API calls to Cinder).
This fix decorates the methods responsible for race condition
with a synchronized() decorator. The problem was with the
management software: DFM, and in principle, there should not
be two processes trying to modify the DFM dataset object at
the same time. This patch prevents from such a possibility.

Fixes bug 1091480

Change-Id: I11cfc8868171acec356f4140aba52b8078d109df
  • Loading branch information
rushiagr committed Feb 26, 2013
1 parent b3aa798 commit 3cff1cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cinder/volume/drivers/netapp/iscsi.py
Expand Up @@ -33,6 +33,7 @@

from cinder import exception
from cinder import flags
from cinder.openstack.common import lockutils
from cinder.openstack.common import log as logging
from cinder.volume import driver
from cinder.volume.drivers.netapp.api import NaApiError
Expand Down Expand Up @@ -383,6 +384,7 @@ def _create_dataset(self, dataset_name, project, ss_type):
self.discovered_datasets.append(ds)
return ds

@lockutils.synchronized('netapp_dfm', 'cinder-', True)
def _provision(self, name, description, project, ss_type, size):
"""Provision a LUN through provisioning manager.
Expand Down Expand Up @@ -443,6 +445,7 @@ def _get_ss_type(self, volume):
return None
return volume_type['name']

@lockutils.synchronized('netapp_dfm', 'cinder-', True)
def _remove_destroy(self, name, project):
"""Remove the LUN from the dataset, also destroying it.
Expand Down

0 comments on commit 3cff1cb

Please sign in to comment.