]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: apply cap mask in choose_lock_state
authorSage Weil <sage@newdream.net>
Tue, 14 Jul 2009 19:27:41 +0000 (12:27 -0700)
committerSage Weil <sage@newdream.net>
Tue, 14 Jul 2009 19:40:38 +0000 (12:40 -0700)
Otherwise we get CAP_GWR and other bits outside of simplelock
mask.

src/mds/CInode.h

index cdfe015be1c619d21fa0cdcf8c1443df0dea060b..c642604124f3b65ada0b4f15eddecf7687bad9f8 100644 (file)
@@ -587,7 +587,7 @@ public:
   // choose new lock state during recovery, based on issued caps
   void choose_lock_state(SimpleLock *lock, int allissued) {
     int shift = lock->get_cap_shift();
-    int issued = allissued >> shift;
+    int issued = (allissued >> shift) & lock->get_cap_mask();
     if (is_auth()) {
       if (issued & CEPH_CAP_GEXCL)
        lock->set_state(LOCK_EXCL);