]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: filelock typo in can_rdlock
authorSage Weil <sage@newdream.net>
Fri, 19 Dec 2008 21:01:29 +0000 (13:01 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Dec 2008 19:45:22 +0000 (11:45 -0800)
src/mds/FileLock.h

index 3da9783fadcb18abec0f776691cfce20a0c82fe0..25462ce29c62ffe007d158930c8fd2567247701d 100644 (file)
@@ -144,12 +144,13 @@ class FileLock : public ScatterLock {
 
   // read/write access
   bool can_rdlock() {
-    if (!parent->is_auth()) {
-      if (state == LOCK_LOCK && !xlock_by)
-       return true;
-      return (state == LOCK_SYNC);
-    } else
-      return (state == LOCK_SYNC);
+    if (parent->is_auth())
+      return
+       (state == LOCK_LOCK && !xlock_by) ||
+       (state == LOCK_SYNC);
+    else
+      return
+       (state == LOCK_SYNC);
   }
   bool can_rdlock_soon() {
     if (parent->is_auth())