From: "Yan, Zheng" Subject: [PATCH 2/2] mds: Adjust mydir auth when starting MDS that was stopped cleanly Date: Mon, 24 Sep 2012 16:37:54 +0800 Message-ID: <1348475874-30464-2-git-send-email-zheng.z.yan@intel.com> References: <1348475874-30464-1-git-send-email-zheng.z.yan@intel.com> Return-path: Received: from mga11.intel.com ([192.55.52.93]:27318 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755245Ab2IXIh5 (ORCPT ); Mon, 24 Sep 2012 04:37:57 -0400 In-Reply-To: <1348475874-30464-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org List-ID: To: sage@inktank.com, ceph-devel@vger.kernel.org Cc: "Yan, Zheng" From: "Yan, Zheng" When starting a MDS that was stopped cleanly, we need manually adjust mydir's auth. This is because MDS log is empty in this case, mydir's auth can not be adjusted during log replay. Signed-off-by: Yan, Zheng --- src/mds/MDCache.cc | 7 +++++++ src/mds/MDCache.h | 1 + src/mds/MDS.cc | 1 + 3 files changed, 9 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index da3affb..1a0e399 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -531,6 +531,13 @@ void MDCache::open_mydir_inode(Context *c) in->fetch(c); } +void MDCache::adjust_mydir_auth() +{ + CDir *mydir = myin->get_or_open_dirfrag(this, frag_t()); + assert(mydir); + adjust_subtree_auth(mydir, mds->whoami); +} + void MDCache::open_root() { dout(10) << "open_root" << dendl; diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 12bdb03..fffb083 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -643,6 +643,7 @@ public: void open_root_inode(Context *c); void open_root(); void open_mydir_inode(Context *c); + void adjust_mydir_auth(); void populate_mydir(); void _create_system_file(CDir *dir, const char *name, CInode *in, Context *fin); diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index d0aac30..d369229 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1232,6 +1232,7 @@ void MDS::starting_done() // start new segment mdlog->start_new_segment(0); + mdcache->adjust_mydir_auth(); mdcache->open_root(); } -- 1.7.11.4