From: Jason Dillaman Date: Wed, 15 Nov 2017 15:35:16 +0000 (-0500) Subject: librbd: invalidating the cache shouldn't hold write lock X-Git-Tag: v12.2.3~167^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2070fcf7d4260e3a13219ce708a46b2c550ccc14;p=ceph.git librbd: invalidating the cache shouldn't hold write lock This can cause deadlock when readahead is in-progress since neither can make forward progress. Fixes: http://tracker.ceph.com/issues/22131 Signed-off-by: Jason Dillaman (cherry picked from commit 6a335481d20c6a765c84d561a01fb52172eccba4) --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index acbe336629c..d2695f57416 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2244,7 +2244,6 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { } RWLock::RLocker owner_locker(ictx->owner_lock); - RWLock::WLocker md_locker(ictx->md_lock); r = ictx->invalidate_cache(false); ictx->perfcounter->inc(l_librbd_invalidate_cache); return r;