]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix recursive locking on owner_lock in ImageDispatch
authorIlya Dryomov <idryomov@gmail.com>
Tue, 28 Mar 2023 17:52:42 +0000 (19:52 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 4 Apr 2023 15:58:36 +0000 (17:58 +0200)
commit1d943f8c47b3510e47d40701e9acd213706754e5
tree3df9ee082f16e08244db3af47d6d043589d190c2
parenta14498eff645e9e154e4d1a3cc436453b8401d89
librbd: fix recursive locking on owner_lock in ImageDispatch

needs_exclusive_lock() calls acquire_lock() with owner_lock held.
If lock acquisiton races with lock shut down, ManagedLock completes
ImageDispatch context directly and dispatch is retried immediately on
the same thread (due to DISPATCH_RESULT_RESTART).  This results in
recursion into needs_exclusive_lock() and, barring locking issues, can
lead to unbounded stack growth if lock shut down takes its time.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/exclusive_lock/ImageDispatch.cc