]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: properly & |'d flags 17285/head
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 20 Jul 2017 12:18:22 +0000 (08:18 -0400)
committerNathan Cutler <ncutler@suse.com>
Sun, 27 Aug 2017 19:15:49 +0000 (21:15 +0200)
Found by "Supriti Singh" <Supriti.Singh@suse.com>.

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

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 5f838c05c72ad46ce01884a916f81275ef43dacd)

src/common/cohort_lru.h

index 8a8b766997261d17f07128923cb1c658ec789981..9e02ec77cddf50e844ba7989260e77887ca82370 100644 (file)
@@ -396,7 +396,7 @@ namespace cohort {
          v = lat.p->cache[slot];
          if (v) {
            if (CEQ()(*v, k)) {
-             if (flags & (FLAG_LOCK|FLAG_UNLOCK))
+             if ((flags & FLAG_LOCK) && (flags & FLAG_UNLOCK))
                lat.lock->unlock();
              return v;
            }
@@ -414,7 +414,7 @@ namespace cohort {
            lat.p->cache[slot] = v;
          }
        }
-       if (flags & (FLAG_LOCK|FLAG_UNLOCK))
+       if ((flags & FLAG_LOCK) && (flags & FLAG_UNLOCK))
          lat.lock->unlock();
        return v;
       } /* find_latch */