rbd: drop dev reference on error in rbd_open()
If a read-only rbd device is opened for writing in rbd_open(), it returns without dropping the just-acquired device reference. Fix this by moving the read-only check before getting the reference. Signed-off-by: NAlex Elder <elder@inktank.com> Reviewed-by: NYehuda Sadeh <yehuda@inktank.com> Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
Showing
想要评论请 注册 或 登录