]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
journal: fix potential race when closing object recorder
authorMykola Golub <mgolub@suse.com>
Thu, 14 Feb 2019 10:57:37 +0000 (12:57 +0200)
committerMykola Golub <mgolub@suse.com>
Thu, 14 Feb 2019 10:59:00 +0000 (12:59 +0200)
commit76234d0023a94e8b965695253072d95f36baa628
treebff3865e7bacf3b73446861642c67e6468deaead
parentd2003782398195b1686360a4f3a0147b88486646
journal: fix potential race when closing object recorder

Calls `send_appends_aio` only if m_pending_buffers is not
empty. It was supposed it was ok to call it even for empty
buffers, because `send_appends_aio` just returned in this
case. But the problem is caused by m_aio_scheduled flag, which is
set before releasing the lock and cleared in `send_appends_aio`,
after reacquiring the lock. If during this time window `close` is
called it will return false due to m_aio_scheduled flag set, and
the caller will expect "closed" notification, which is never
fired in this case.

Fixes: https://tracker.ceph.com/issues/38315
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/journal/ObjectRecorder.cc