From: Alex Elder Date: Fri, 31 May 2013 20:17:01 +0000 (-0500) Subject: rbd: set removing flag while holding list lock X-Git-Tag: v3.11-rc1~69^2~25 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=751cc0e3cfabdda87c4c21519253c6751e97a8d4;p=pandora-kernel.git rbd: set removing flag while holding list lock When unmapping a device, its id is supplied, and that is used to look up which rbd device should be unmapped. Looking up the device involves searching the rbd device list while holding a spinlock that protects access to that list. Currently all of this is done under protection of the control lock, but that protection is going away soon. To ensure the rbd_dev is still valid (still on the list) while setting its REMOVING flag, do so while still holding the list lock. To do so, get rid of __rbd_get_dev(), and open code what it did in the one place it was used. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- Reading git-diff-tree failed