]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: reissue all caps after recovery
authorSage Weil <sage@newdream.net>
Wed, 8 Jul 2009 03:11:31 +0000 (20:11 -0700)
committerSage Weil <sage@newdream.net>
Wed, 8 Jul 2009 17:48:10 +0000 (10:48 -0700)
This ensures that locks get kicked after recovery.  Otherwise we may have
a client who ends up with the caps they had before, waiting for the MDS to
issue say RD and no progress being made.

src/mds/Locker.cc
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDS.cc

index c7f8d532b335fb6704416acf0e78f79b14fd6a4c..eba2a69b4a692c76dbed76d834304ce7d199b94b 100644 (file)
@@ -1103,7 +1103,6 @@ Capability* Locker::issue_new_caps(CInode *in,
 
 
 
-
 bool Locker::issue_caps(CInode *in, Capability *only_cap)
 {
   // allowed caps are determined by the lock mode.
index 16b95c9b7690cc8e2482e48126a0490bd47f7a87..4b28b349999d3b32c4a8c1a4ec327f9f7c069d7f 100644 (file)
@@ -4021,6 +4021,8 @@ void MDCache::do_delayed_cap_imports()
        }
       }
       in->auth_unpin(this);
+
+      mds->locker->issue_caps(in);
     }
   }    
 }
@@ -4215,6 +4217,19 @@ void MDCache::rejoin_send_acks()
 }
 
 
+void MDCache::reissue_all_caps()
+{
+  dout(10) << "reissue_all_caps" << dendl;
+
+  for (hash_map<vinodeno_t,CInode*>::iterator p = inode_map.begin();
+       p != inode_map.end();
+       ++p) {
+    CInode *in = p->second;
+    if (in->is_any_caps())
+      mds->locker->issue_caps(in);
+  }
+}
+
 
 // ===============================================================================
 
index 23f63d1405b264283b78df4448cf8bce43dec823..0e72a1209914b128338b286b0451c7c1650bdd76 100644 (file)
@@ -756,7 +756,7 @@ public:
   void do_delayed_cap_imports();
   void open_snap_parents();
 
-
+  void reissue_all_caps();
   
 
   friend class Locker;
index 9ea4681dc9f240936c727b45eb3f7be6e37d702d..4938d5882745d248ed08a61218dd7ecf75e199c0 100644 (file)
@@ -1048,6 +1048,8 @@ void MDS::recovery_done()
   
   mdcache->start_recovered_truncates();
   mdcache->do_file_recover();
+
+  mdcache->reissue_all_caps();
   
   // tell connected clients
   bcast_mds_map();