]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix LRU lane lock in evict_block() 17597/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 25 Aug 2017 21:55:11 +0000 (17:55 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 8 Sep 2017 10:53:14 +0000 (12:53 +0200)
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 3301596734adcbda1e8e76a742935efdeb7518fd)

src/common/cohort_lru.h

index 8a8b766997261d17f07128923cb1c658ec789981..2a920e4a4f86d5ada88b2a57355cba5445908f4b 100644 (file)
@@ -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 */