diff mbox

[09/12] mds: Properly update dirty dir fragstat during log replay

Message ID 1349168152-13281-9-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Oct. 2, 2012, 8:55 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Dirty dir fragstat is managed by filelock instead of nestlock.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/journal.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/src/mds/journal.cc b/src/mds/journal.cc
index 38f8c0e..0de3f39 100644
--- a/src/mds/journal.cc
+++ b/src/mds/journal.cc
@@ -488,14 +488,20 @@  void EMetaBlob::replay(MDS *mds, LogSegment *logseg)
       dir->get_inode()->filelock.mark_dirty();
       dir->get_inode()->nestlock.mark_dirty();
 
-      if (!(dir->fnode.rstat == dir->fnode.accounted_rstat) ||
-	  !(dir->fnode.fragstat == dir->fnode.accounted_fragstat)) {
+      if (!(dir->fnode.rstat == dir->fnode.accounted_rstat)) {
 	dout(10) << "EMetaBlob.replay      dirty nestinfo on " << *dir << dendl;
 	mds->locker->mark_updated_scatterlock(&dir->inode->nestlock);
 	logseg->dirty_dirfrag_nest.push_back(&dir->inode->item_dirty_dirfrag_nest);
       } else {
 	dout(10) << "EMetaBlob.replay      clean nestinfo on " << *dir << dendl;
       }
+      if (!(dir->fnode.fragstat == dir->fnode.accounted_fragstat)) {
+	dout(10) << "EMetaBlob.replay      dirty fragstat on " << *dir << dendl;
+	mds->locker->mark_updated_scatterlock(&dir->inode->filelock);
+	logseg->dirty_dirfrag_dir.push_back(&dir->inode->item_dirty_dirfrag_dir);
+      } else {
+	dout(10) << "EMetaBlob.replay      clean fragstat on " << *dir << dendl;
+      }
     }
     if (lump.is_new())
       dir->mark_new(logseg);