From: Jason Dillaman Date: Tue, 27 Jun 2017 19:51:54 +0000 (-0400) Subject: librbd: fix missing write block validation in IO work queue X-Git-Tag: v12.1.1~185^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e76ebd93fd7525f6909a7da178e9b92c98e1ebe;p=ceph.git librbd: fix missing write block validation in IO work queue Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/ImageRequestWQ.cc b/src/librbd/io/ImageRequestWQ.cc index 4ed38eadeb3f..e80e90088d2a 100644 --- a/src/librbd/io/ImageRequestWQ.cc +++ b/src/librbd/io/ImageRequestWQ.cc @@ -467,9 +467,16 @@ void *ImageRequestWQ::_void_dequeue() { RWLock::RLocker locker(m_lock); bool write_op = peek_item->is_write_op(); lock_required = is_lock_required(write_op); - if (write_op && !lock_required && !refresh_required) { - // completed ops will requeue the IO -- don't count it as in-progress - m_in_flight_writes++; + if (write_op) { + if (!lock_required && m_write_blockers > 0) { + // missing lock is not the write blocker + return nullptr; + } + + if (!lock_required && !refresh_required) { + // completed ops will requeue the IO -- don't count it as in-progress + m_in_flight_writes++; + } } }