]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix LRU lane lock in evict_block() 17267/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 25 Aug 2017 21:55:11 +0000 (17:55 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 25 Aug 2017 21:55:11 +0000 (17:55 -0400)
Found by "Supriti Singh" <Supriti.Singh@suse.com>.

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

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/common/cohort_lru.h

index 8d579cb99bbd2aaff2ea1275aad583732395c63b..6c8264a5efd0c21ba071736fa872027e8b4dbfca 100644 (file)
@@ -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)) {
@@ -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 */