]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix multiclient RD+WR loner logic
authorSage Weil <sage@newdream.net>
Tue, 11 Aug 2009 17:59:20 +0000 (10:59 -0700)
committerSage Weil <sage@newdream.net>
Tue, 11 Aug 2009 17:59:20 +0000 (10:59 -0700)
We want to go mix if there is a mix of RD and WR wanted, not
just multiple writers.

src/mds/CInode.h
src/mds/Locker.cc

index a51070bcf0df303fcfc77670fa86f0c1c77eee56..e09b239b2c1016772b99dfca64a4c2d7987bc6cd 100644 (file)
@@ -549,7 +549,8 @@ public:
          it != client_caps.end();
          it++) 
       if (!it->second->is_stale() &&
-         ((it->second->wanted() & CEPH_CAP_ANY_WR) || inode.is_dir())) {
+         ((it->second->wanted() & (CEPH_CAP_ANY_WR|CEPH_CAP_FILE_WR|CEPH_CAP_FILE_RD))
+          || inode.is_dir())) {
        if (n)
          return false;
        n++;
index 810c8c0ca7e0a7dcd3776d06a03ec3345423b571..ddf117d657b601095b2ef4bb17ac5e70a49f0b8c 100644 (file)
@@ -3095,7 +3095,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue)
        (in->inode.is_dir() && in->multiple_nonstale_caps())) {  // FIXME.. :/
       dout(20) << " should lose it" << dendl;
       // we should lose it.
-      if ((other_wanted & CEPH_CAP_GWR) ||
+      if ((other_wanted & (CEPH_CAP_GRD|CEPH_CAP_GWR)) ||
          lock->is_waiter_for(SimpleLock::WAIT_WR))
        file_mixed(lock, need_issue);
       else if (!lock->is_wrlocked())   // let excl wrlocks drain first