]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl: fix assert in _aio_stop() during shutdown 42950/head
authorYin Congmin <congmin.yin@intel.com>
Wed, 15 Sep 2021 11:23:43 +0000 (11:23 +0000)
committerYin Congmin <congmin.yin@intel.com>
Tue, 2 Nov 2021 01:36:56 +0000 (09:36 +0800)
commit94f9873718a82d2def8f268c1581fbf97fee0f49
treeecc6949a206c44af15607bbac248d0fcde6c92dc
parentc531768838e44ed8eb28e8b27594d7e03ca3ffcf
librbd/cache/pwl: fix assert in _aio_stop() during shutdown

For wait_for_ops(next_ctx). this next_ctx may run in aio_thread.
Then the next program runs on the aio thread. remove_pool_file()
calls bdev->close(), then calles _aio_stop(), exec aio_thread.join(),
cause assert. Thread can't join itself. Fix it by adding close ctx
to m_work_queue, so close() can run in work queue thread.

At the same time, correct the order of wait_for_ops().
flush_dirty_entries(next_ctx) may call wake_up() and start_op().
so moving wait_for_ops() behind flush_dirty_entries(next_ctx) is more
appropriate.

Fixes: https://tracker.ceph.com/issues/52566
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
src/librbd/cache/pwl/AbstractWriteLog.cc