Skip to content

Commit

Permalink
rgw_file: fix LRU lane lock in evict_block()
Browse files Browse the repository at this point in the history
Found by "Supriti Singh" <Supriti.Singh@suse.com>.

Fixes http://tracker.ceph.com/issues/21141

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 3301596)
  • Loading branch information
mattbenjamin authored and smithfarm committed Sep 5, 2017
1 parent 8235853 commit 63c9382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/cohort_lru.h
Expand Up @@ -136,6 +136,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 (can_reclaim(o)) {
Expand All @@ -156,7 +157,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 */
Expand Down

0 comments on commit 63c9382

Please sign in to comment.