diff options
author | Alex Elder <elder@dreamhost.com> | 2012-01-12 04:42:15 +0100 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-01-12 20:00:50 +0100 |
commit | 0e805a1d857799352e51e8697c0b1a30aec16913 (patch) | |
tree | bc6ad83e25af597f40b03170026c3e5d331c2814 | |
parent | ceph: enable/disable dentry complete flags via mount option (diff) | |
download | linux-0e805a1d857799352e51e8697c0b1a30aec16913.tar.xz linux-0e805a1d857799352e51e8697c0b1a30aec16913.zip |
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 <elder@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r-- | drivers/block/rbd.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |