summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-09-19 13:34:39 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-09-24 08:45:55 +0800
commitf76f73526819298bf8dce89e491e4a48dee386da (patch)
tree3da53de116fc3e5d1b864a6d12bc5d3efc1ada3b
parentfc0cfac49f884e5f19a8f62b751f78758dcf19e8 (diff)
downloadceph-f76f73526819298bf8dce89e491e4a48dee386da.tar.gz
mds: properly store fragmenting dirfrags
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>
-rw-r--r--src/mds/CDir.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc
index c77ca180a6f..1b3c7e63456 100644
--- a/src/mds/CDir.cc
+++ b/src/mds/CDir.cc
@@ -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 {