]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 17 Feb 2006 00:30:06 +0000 (00:30 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 17 Feb 2006 00:30:06 +0000 (00:30 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@650 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/CDentry.cc
ceph/mds/CDir.h
ceph/mds/MDBalancer.cc
ceph/mds/MDCache.cc
ceph/mds/MDStore.cc

index 013236d455a8415016a326b51345b03f0a7afdf0..13b0704954a578fb13ae10d190866bca7288bb08 100644 (file)
@@ -76,7 +76,12 @@ void CDentry::mark_dirty()
 }
 void CDentry::mark_clean() {
   dout(10) << " mark_clean " << *this << endl;
+  assert(dirty);
   assert(parent_dir_version <= dir->get_version());
+
+  if (parent_dir_version < dir->get_last_committed_version())
+       cerr << " bad mark_clean " << *this << endl;    
+
   assert(parent_dir_version >= dir->get_last_committed_version());
 
   if (is_primary() && dirty && inode) inode->put(CINODE_PIN_DNDIRTY);
index aa4d9b4af102807ced476df15f1afa6489d596d9..661a83e96dca2e34035c09c6242450ed0d6ac0ce 100644 (file)
@@ -97,7 +97,8 @@ class Context;
 #define CDIR_MASK_STATE_EXPORT_KEPT (CDIR_STATE_HASHED\
                                     |CDIR_STATE_FROZENTREE\
                                     |CDIR_STATE_FROZENDIR\
-                                    |CDIR_STATE_EXPORT)
+                                    |CDIR_STATE_EXPORT\
+                                                                        |CDIR_STATE_PROXY)
 
 // common states
 #define CDIR_STATE_CLEAN   0
index dcd2e8239687fe1bc0c5d7d2989bc923bf891250..ab3f6a3a62c97775e2b308c008d9a115a44abe9a 100644 (file)
@@ -690,7 +690,7 @@ void MDBalancer::add_import(CDir *dir)
 
 void MDBalancer::show_imports(bool external)
 {
-  int db = 7; //debug level
+  int db = 20; //debug level
 
   
   if (mds->mdcache->imports.empty() &&
index 798f6f08820c75be5d6aaed5cb7e4145068ecaa1..babfa7b0da14cea1c5af14db4ae8ed90ec740dd2 100644 (file)
@@ -2394,6 +2394,8 @@ void MDCache::handle_cache_expire(MCacheExpire *m)
        if (!dir->is_auth()) {
          int newauth = dir->authority();
          dout(7) << "proxy dir expire on " << *dir << " to " << newauth << endl;
+         if (!dir->is_proxy())
+               dout(0) << "nonproxy dir expire? " << *dir << " .. auth is " << newauth << " .. expire is from " << from << endl;
          assert(dir->is_proxy());
          assert(newauth >= 0);
          assert(dir->state_test(CDIR_STATE_PROXY));
@@ -6209,6 +6211,7 @@ void MDCache::handle_export_dir_notify_ack(MExportDirNotifyAck *m)
                 it++) {
          CInode *in = get_inode(*it);
          in->put(CINODE_PIN_PROXY);
+         assert(in->state_test(CINODE_STATE_PROXY));
          in->state_clear(CINODE_STATE_PROXY);
        }
        export_proxy_inos.erase(dir);
@@ -6219,6 +6222,7 @@ void MDCache::handle_export_dir_notify_ack(MExportDirNotifyAck *m)
                 it++) {
          CDir *dir = get_inode(*it)->dir;
          dir->put(CDIR_PIN_PROXY);
+         assert(dir->state_test(CDIR_STATE_PROXY));
          dir->state_clear(CDIR_STATE_PROXY);
 
          // hose neg dentries, too, since we're no longer auth
@@ -6230,8 +6234,9 @@ void MDCache::handle_export_dir_notify_ack(MExportDirNotifyAck *m)
                  assert(dn->is_sync());
                  dir->remove_dentry(dn);
                } else {
-                 dout(10) << "export_dir_notify_ack leaving xlocked neg " << *dn << endl;
-                 dn->mark_clean();
+                 //dout(10) << "export_dir_notify_ack leaving xlocked neg " << *dn << endl;
+                 if (dn->is_dirty())
+                       dn->mark_clean();
                }
          }
        }
@@ -7620,6 +7625,7 @@ void MDCache::hash_dir_finish(CDir *dir)
           it != hash_proxy_inos[dir].end();
           it++) {
        CInode *in = *it;
+       assert(in->state_test(CINODE_STATE_PROXY));
        in->state_clear(CINODE_STATE_PROXY);
        in->put(CINODE_PIN_PROXY);
   }
@@ -8614,6 +8620,7 @@ void MDCache::handle_unhash_dir_notify(MUnhashDirNotify *m)
           it != hash_proxy_inos[dir].end();
           it++) {
        CInode *in = *it;
+       assert(in->state_test(CINODE_STATE_PROXY));
        in->state_clear(CINODE_STATE_PROXY);
        in->put(CINODE_PIN_PROXY);
   }
index 6eb966eb93cb8cc73a73317b6d651a280e74d615..b948aa27253e30112956433ed0c22593343027f7 100644 (file)
@@ -700,7 +700,8 @@ void MDStore::commit_dir_slice_2( int result,
        }
        else if (dn->get_parent_dir_version() == committed_version) {
          dout(15) << " dir " << committed_version << " == dn " << dn->get_parent_dir_version() << " now clean " << *dn << endl;
-         dn->mark_clean();     // might not but could be dirty
+         if (dn->is_dirty())
+               dn->mark_clean();     // might not but could be dirty
          
          // remove, if it's null and unlocked
          if (dn->is_null() && dn->is_sync()) {