summaryrefslogtreecommitdiffstats
path: root/src/mds/CDir.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/CDir.cc')
-rw-r--r--src/mds/CDir.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc
index 76e9fee68f8..7d28e039d9c 100644
--- a/src/mds/CDir.cc
+++ b/src/mds/CDir.cc
@@ -2494,6 +2494,10 @@ void CDir::_omap_commit_ops(int r, int op_prio, int64_t metapool, version_t vers
mdcache->mds->heartbeat_reset();
}
+ // the last omap commit includes the omap header, so account for
+ // that size early on so that when we reach `commit_one(true)`,
+ // there is enough space for the header.
+ write_size += sizeof(fnode_t);
using ceph::encode;
for (auto &item : to_set) {
bufferlist bl;
@@ -3808,10 +3812,13 @@ bool CDir::should_split_fast() const
const CDentry *dn = p.second;
if (!dn->get_projected_linkage()->is_null()) {
effective_size++;
+
+ if (effective_size > fast_limit) [[unlikely]]
+ return true;
}
}
- return effective_size > fast_limit;
+ return false;
}
bool CDir::should_merge() const