]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Storwize/SVC: Fix races in host-related functions
authorAvishay Traeger <avishay@il.ibm.com>
Sat, 8 Feb 2014 20:59:58 +0000 (22:59 +0200)
committerAvishay Traeger <avishay@il.ibm.com>
Sun, 9 Feb 2014 09:23:16 +0000 (11:23 +0200)
commit5ba26c8aa5b295a1202fbc6c01eb050ce3f3af3d
tree3e1416d9c9c81af60213b9b02316bc3be989cf32
parent0e5b1bfe4fa3dcdfa9e9ed5d6843842861e51b97
Storwize/SVC: Fix races in host-related functions

In the Storwize/SVC driver, initialize_connection checks if a host
object exists on the storage, and if not, creates one. Similarly,
terminate_connection checks if there are any more mappings for this
host, and deletes the host object if there are none. Consequently, there
exist races between two initialize_connection calls, two
terminate_connection calls, or one and one.

The easy solution here is to use locks. Because locks are files on the
local machine, this implies that all cinder-volume processes managing a
given Storwize/SVC contoller run on the same machine.

Change-Id: I62cd992e7150e7d16f1a2b2be6ef61c64b638858
Closes-Bug: #1274123
cinder/volume/drivers/ibm/storwize_svc/__init__.py