]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: properly & |'d flags 16448/head
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 20 Jul 2017 12:18:22 +0000 (08:18 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 20 Jul 2017 12:18:22 +0000 (08:18 -0400)
Found by "Supriti Singh" <Supriti.Singh@suse.com>.

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

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

index 13c760f76f2e69814b75b7c274e3ede3fd9c44d1..2d003d1df2a8c236b1b3eecc0a7983b64c98a272 100644 (file)
@@ -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 */