From 02159898147053fa492ec597bceb9096d160be08 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Fri, 25 Aug 2017 17:55:11 -0400 Subject: [PATCH] rgw_file: fix LRU lane lock in evict_block() Found by "Supriti Singh" . Fixes http://tracker.ceph.com/issues/21141 Signed-off-by: Matt Benjamin (cherry picked from commit 3301596734adcbda1e8e76a742935efdeb7518fd) --- src/common/cohort_lru.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h index 8a8b76699726..2a920e4a4f86 100644 --- a/src/common/cohort_lru.h +++ b/src/common/cohort_lru.h @@ -131,6 +131,7 @@ namespace cohort { for (int ix = 0; ix < n_lanes; ++ix, lane_ix = next_evict_lane()) { Lane& lane = qlane[lane_ix]; + lane.lock.lock(); /* if object at LRU has refcnt==1, it may be reclaimable */ Object* o = &(lane.q.back()); #if 0 /* XXX save for refactor */ @@ -157,7 +158,6 @@ namespace cohort { return o; } else { // XXX can't make unreachable (means what?) - lane.lock.lock(); --(o->lru_refcnt); o->lru_flags &= ~FLAG_EVICTING; /* unlock in next block */ -- 2.47.3