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.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc
index f000da7928a..7d28e039d9c 100644
--- a/src/mds/CDir.cc
+++ b/src/mds/CDir.cc
@@ -1319,7 +1319,7 @@ void CDir::take_dentry_waiting(std::string_view dname, snapid_t first, snapid_t
<< it->first.snapid
<< " on " << *this << dendl;
std::copy(it->second.begin(), it->second.end(), std::back_inserter(ls));
- waiting_on_dentry.erase(it++);
+ it = waiting_on_dentry.erase(it);
}
if (waiting_on_dentry.empty())
@@ -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;
@@ -2823,8 +2827,6 @@ void CDir::_committed(int r, version_t v)
auto it = waiting_for_commit.begin();
while (it != waiting_for_commit.end()) {
- auto _it = it;
- ++_it;
if (it->first > committed_version) {
dout(10) << " there are waiters for " << it->first << ", committing again" << dendl;
_commit(it->first, -1);
@@ -2834,8 +2836,7 @@ void CDir::_committed(int r, version_t v)
for (const auto &waiter : it->second)
t.push_back(waiter);
mdcache->mds->queue_waiters(t);
- waiting_for_commit.erase(it);
- it = _it;
+ it = waiting_for_commit.erase(it);
if (!(++count % mdcache->mds->heartbeat_reset_grace()))
mdcache->mds->heartbeat_reset();
@@ -3811,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