From: Alex Elder Date: Thu, 12 Jan 2012 03:42:15 +0000 (-0800) Subject: rbd: initialize snap_rwsem in rbd_add() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e805a1d857799352e51e8697c0b1a30aec16913;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git rbd: initialize snap_rwsem in rbd_add() New rbd device structures get initialized in rbd_add(). Many of the fields rely on being initially zero-filled. However we lockdep was noticing that the rw_semaphore embedded in the header field was not getting properly initialized. Fix that. Signed-off-by: Alex Elder Signed-off-by: Sage Weil --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 148ab944378d..3fd31dec8c9c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2184,6 +2184,8 @@ static ssize_t rbd_add(struct bus_type *bus, INIT_LIST_HEAD(&rbd_dev->node); INIT_LIST_HEAD(&rbd_dev->snaps); + init_rwsem(&rbd_dev->header.snap_rwsem); + /* generate unique id: find highest unique id, add one */ mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);