From 4ae7ec765120f5681e3bc6ec2ee3ab6805babad5 Mon Sep 17 00:00:00 2001 From: sage Date: Fri, 17 Feb 2006 00:30:06 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@650 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/mds/CDentry.cc | 5 +++++ ceph/mds/CDir.h | 3 ++- ceph/mds/MDBalancer.cc | 2 +- ceph/mds/MDCache.cc | 11 +++++++++-- ceph/mds/MDStore.cc | 3 ++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ceph/mds/CDentry.cc b/ceph/mds/CDentry.cc index 013236d455a84..13b0704954a57 100644 --- a/ceph/mds/CDentry.cc +++ b/ceph/mds/CDentry.cc @@ -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); diff --git a/ceph/mds/CDir.h b/ceph/mds/CDir.h index aa4d9b4af1028..661a83e96dca2 100644 --- a/ceph/mds/CDir.h +++ b/ceph/mds/CDir.h @@ -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 diff --git a/ceph/mds/MDBalancer.cc b/ceph/mds/MDBalancer.cc index dcd2e8239687f..ab3f6a3a62c97 100644 --- a/ceph/mds/MDBalancer.cc +++ b/ceph/mds/MDBalancer.cc @@ -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() && diff --git a/ceph/mds/MDCache.cc b/ceph/mds/MDCache.cc index 798f6f08820c7..babfa7b0da14c 100644 --- a/ceph/mds/MDCache.cc +++ b/ceph/mds/MDCache.cc @@ -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); } diff --git a/ceph/mds/MDStore.cc b/ceph/mds/MDStore.cc index 6eb966eb93cb8..b948aa27253e3 100644 --- a/ceph/mds/MDStore.cc +++ b/ceph/mds/MDStore.cc @@ -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()) { -- 2.39.5