]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush log when expanding caps and filelock is unstable
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 6 Apr 2009 22:53:10 +0000 (15:53 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 6 Apr 2009 22:53:10 +0000 (15:53 -0700)
src/mds/Locker.cc

index c779f44b5dd6f7e1b2b97842bde39aacbca9c95b..6bdda7e1c5100235f07d7f6fc97a0c7bb03d1bba 100644 (file)
@@ -964,7 +964,9 @@ Capability* Locker::issue_new_caps(CInode *in,
 
   if (in->is_auth()) {
     // [auth] twiddle mode?
-    if (in->filelock.is_stable()) 
+    if (!in->filelock.is_stable())
+      mds->mdlog->flush();
+    else
       file_eval(&in->filelock);
   } else {
     // [replica] tell auth about any new caps wanted
@@ -1534,6 +1536,11 @@ void Locker::handle_client_caps(MClientCaps *m)
                              m->get_caps(), 0, m->get_dirty(), 0);
       }
       if (wanted != cap->wanted()) {
+        if (wanted & ~cap->wanted()) {
+          // exapnding caps.  make sure we aren't waiting for a log flush
+          if (!in->filelock.is_stable())
+            mds->mdlog->flush();
+        }
        if (ceph_seq_cmp(m->get_seq(), cap->get_last_issue()) == 0) {
          dout(10) << " wanted " << ccap_string(cap->wanted())
                   << " -> " << ccap_string(wanted) << dendl;