Skip to content

Commit f51ea04

Browse files
committed
mds/CDir: use the erase() return value
Signed-off-by: Max Kellermann <[email protected]>
1 parent ac30518 commit f51ea04

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/mds/CDir.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ void CDir::take_dentry_waiting(std::string_view dname, snapid_t first, snapid_t
13191319
<< it->first.snapid
13201320
<< " on " << *this << dendl;
13211321
std::copy(it->second.begin(), it->second.end(), std::back_inserter(ls));
1322-
waiting_on_dentry.erase(it++);
1322+
it = waiting_on_dentry.erase(it);
13231323
}
13241324

13251325
if (waiting_on_dentry.empty())
@@ -2823,8 +2823,6 @@ void CDir::_committed(int r, version_t v)
28232823

28242824
auto it = waiting_for_commit.begin();
28252825
while (it != waiting_for_commit.end()) {
2826-
auto _it = it;
2827-
++_it;
28282826
if (it->first > committed_version) {
28292827
dout(10) << " there are waiters for " << it->first << ", committing again" << dendl;
28302828
_commit(it->first, -1);
@@ -2834,8 +2832,7 @@ void CDir::_committed(int r, version_t v)
28342832
for (const auto &waiter : it->second)
28352833
t.push_back(waiter);
28362834
mdcache->mds->queue_waiters(t);
2837-
waiting_for_commit.erase(it);
2838-
it = _it;
2835+
it = waiting_for_commit.erase(it);
28392836

28402837
if (!(++count % mdcache->mds->heartbeat_reset_grace()))
28412838
mdcache->mds->heartbeat_reset();

0 commit comments

Comments
 (0)