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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>

Dirty dir fragstat is managed by filelock instead of nestlock.

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

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);
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux