Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e805a1d authored by Alex Elder's avatar Alex Elder Committed by Sage Weil
Browse files

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: default avatarAlex Elder <elder@dreamhost.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent a40dc6cc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);