From: Matt Benjamin Date: Thu, 20 Jul 2017 12:18:22 +0000 (-0400) Subject: rgw_file: properly & |'d flags X-Git-Tag: v10.2.10~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ab2e5fde02b705658d4e763519282cad3f0b173;p=ceph.git rgw_file: properly & |'d flags Found by "Supriti Singh" . Fixes http://tracker.ceph.com/issues/20663 Signed-off-by: Matt Benjamin (cherry picked from commit 5f838c05c72ad46ce01884a916f81275ef43dacd) --- diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h index 8a8b76699726..9e02ec77cddf 100644 --- a/src/common/cohort_lru.h +++ b/src/common/cohort_lru.h @@ -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 */