]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't journal opened non-auth inode
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 21 Jan 2013 02:04:03 +0000 (10:04 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 29 Jan 2013 02:17:36 +0000 (10:17 +0800)
If we journal opened non-auth inode, during journal replay, the corresponding
entry will add non-auth objects to the cache. But the MDS does not journal all
subsequent modifications (rmdir,rename) to these non-auth objects, so the code
that manages cache and subtree may get confused. Besides non-auth objects will
be trimmed at the resolve stage.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Locker.cc
src/mds/Migrator.cc
src/mds/Server.cc
src/mds/journal.cc

index 8847db69339305280ebf19c145b3babfc0a4f5dc..aac9cf30a47199da968a51f35452014d61a8f083 100644 (file)
@@ -2141,6 +2141,8 @@ void Locker::adjust_cap_wanted(Capability *cap, int wanted, int issue_seq)
   }
 
   CInode *cur = cap->get_inode();
+  if (!cur->is_auth())
+    return;
   if (cap->wanted() == 0) {
     if (cur->item_open_file.is_on_list() &&
        !cur->is_any_caps_wanted()) {
index bda8035bb4fcb94349e664eada6ea9642859df6e..453cfafef4300453f60414c94d3e51e9c171fe53 100644 (file)
@@ -1093,6 +1093,8 @@ void Migrator::finish_export_inode(CInode *in, utime_t now, list<Context*>& fini
   
   in->clear_dirty_rstat();
 
+  in->item_open_file.remove_myself();
+
   // waiters
   in->take_waiting(CInode::WAIT_ANY_MASK, finished);
   
index 2b5c9e53bad947b110c97ecd45875a20a7a9798f..7a4593242831466048274ec97657a80ff78eb95c 100644 (file)
@@ -2549,7 +2549,8 @@ void Server::handle_client_open(MDRequest *mdr)
     mds->locker->check_inode_max_size(cur);
 
   // make sure this inode gets into the journal
-  if (!cur->item_open_file.is_on_list() && cur->last == CEPH_NOSNAP) {
+  if (cur->is_auth() && cur->last == CEPH_NOSNAP &&
+      !cur->item_open_file.is_on_list()) {
     LogSegment *ls = mds->mdlog->get_current_segment();
     EOpen *le = new EOpen(mds->mdlog);
     mdlog->start_entry(le);
index 429608ad0363937cb4c1a889718d9c0317d07cc9..ff09e15d9f85144a9c4b667adb47ea5541463a30 100644 (file)
@@ -145,7 +145,7 @@ void LogSegment::try_to_expire(MDS *mds, C_GatherBuilder &gather_bld)
       CInode *in = *p;
       assert(in->last == CEPH_NOSNAP);
       ++p;
-      if (in->is_any_caps()) {
+      if (in->is_auth() && in->is_any_caps()) {
        if (in->is_any_caps_wanted()) {
          dout(20) << "try_to_expire requeueing open file " << *in << dendl;
          if (!le) {