]> git-server-git.apps.pok.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>
Thu, 6 Apr 2023 15:08:08 +0000 (17:08 +0200)
commit314908c36f8762bd599a24a737e2e3f68f6a1026
tree5ab21c59a9bdd77f27c118a4cefc541b1b420492
parentb88e01372b50e4a47ea4aa50690efccee6d062ae
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>
(cherry picked from commit 1d943f8c47b3510e47d40701e9acd213706754e5)
src/librbd/exclusive_lock/ImageDispatch.cc