]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: properly store fragmenting dirfrags
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 19 Sep 2013 05:34:39 +0000 (13:34 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sat, 5 Oct 2013 03:31:11 +0000 (11:31 +0800)
fragmenting dirfrag does not exist on the object store. So all non-null
dentries should be included when committing a fragmenting dirfrag.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/CDir.cc

index c77ca180a6fe4d95d80415f6fae783ab90cfdf5e..1b3c7e63456000cfeaff103b6590fc592816a5c0 100644 (file)
@@ -1851,7 +1851,8 @@ CDir::map_t::iterator CDir::_commit_partial(ObjectOperation& m,
        try_trim_snap_dentry(dn, *snaps))
       continue;
 
-    if (!dn->is_dirty())
+    if (!dn->is_dirty() &&
+       (!dn->state_test(CDentry::STATE_FRAGMENTING) || dn->get_linkage()->is_null()))
       continue;  // skip clean dentries
 
     if (dn->get_linkage()->is_null()) {
@@ -1995,7 +1996,8 @@ void CDir::_commit(version_t want)
   unsigned max_write_size = cache->max_dir_commit_size;
 
   if (is_complete() &&
-      (num_dirty > (num_head_items*g_conf->mds_dir_commit_ratio))) {
+      ((num_dirty > (num_head_items*g_conf->mds_dir_commit_ratio)) ||
+       state_test(CDir::STATE_FRAGMENTING))) {
     fnode.snap_purged_thru = realm->get_last_destroyed();
     committed_dn = _commit_full(m, snaps, max_write_size);
   } else {