Skip to content

Commit 2394be1

Browse files
committed
rbd: don't assume rbd_is_lock_owner() for exclusive mappings
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.35.1.el9_4 commit-author Ilya Dryomov <idryomov@gmail.com> commit 3ceccb1 Expanding on the previous commit, assuming that rbd_is_lock_owner() always returns true (i.e. that we are either in RBD_LOCK_STATE_LOCKED or RBD_LOCK_STATE_QUIESCING) if the mapping is exclusive is wrong too. In case ceph_cls_set_cookie() fails, the lock would be temporarily released even if the mapping is exclusive, meaning that we can end up even in RBD_LOCK_STATE_UNLOCKED. IOW, exclusive mappings are really "just" about disabling automatic lock transitions (as documented in the man page), not about grabbing the lock and holding on to it whatever it takes. Cc: stable@vger.kernel.org Fixes: 637cd06 ("rbd: new exclusive lock wait/wake code") Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn> (cherry picked from commit 3ceccb1) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 17df4fd commit 2394be1

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/block/rbd.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6590,11 +6590,6 @@ static int rbd_add_acquire_lock(struct rbd_device *rbd_dev)
65906590
if (ret)
65916591
return ret;
65926592

6593-
/*
6594-
* The lock may have been released by now, unless automatic lock
6595-
* transitions are disabled.
6596-
*/
6597-
rbd_assert(!rbd_dev->opts->exclusive || rbd_is_lock_owner(rbd_dev));
65986593
return 0;
65996594
}
66006595

0 commit comments

Comments
 (0)