From 5f838c05c72ad46ce01884a916f81275ef43dacd Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Thu, 20 Jul 2017 08:18:22 -0400 Subject: [PATCH] rgw_file: properly & |'d flags Found by "Supriti Singh" . Fixes http://tracker.ceph.com/issues/20663 Signed-off-by: Matt Benjamin --- src/common/cohort_lru.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h index 13c760f76f2..2d003d1df2a 100644 --- a/src/common/cohort_lru.h +++ b/src/common/cohort_lru.h @@ -388,7 +388,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; } @@ -406,7 +406,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 */ -- 2.47.3