From: Samuel Just Date: Sat, 8 Jun 2024 00:31:53 +0000 (+0000) Subject: crimson/.../object_context_loader: remove impossible branch in get_or_load_obc X-Git-Tag: testing/wip-rishabh-testing-20240628.135345-debug~48^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9e0467caa633e2135faf03b027935c4e30b7c068;p=ceph-ci.git crimson/.../object_context_loader: remove impossible branch in get_or_load_obc Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index 3f3f78964c4..97e26e50ded 100644 --- a/src/crimson/osd/object_context_loader.cc +++ b/src/crimson/osd/object_context_loader.cc @@ -158,20 +158,11 @@ using crimson::common::local_conf; // See ObjectContext::_with_lock(), // this function must be able to support atomicity before // acquiring the lock - if (obc->loading_mutex.try_lock()) { - return _get_or_load_obc(obc, existed - ).finally([obc]{ - obc->loading_mutex.unlock(); - }); - } else { - return interruptor::with_lock(obc->loading_mutex, - [this, obc, existed, FNAME] { - // Previous user already loaded the obc - DEBUGDPP("{} finished waiting for loader, cache hit on {}", - dpp, FNAME, obc->get_oid()); - return get_obc(obc, existed); - }); - } + ceph_assert(obc->loading_mutex.try_lock()); + return _get_or_load_obc(obc, existed + ).finally([obc]{ + obc->loading_mutex.unlock(); + }); } template