Skip to content

Commit

Permalink
client: cleanup unsafe requests if MDS session is reset
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <[email protected]>
  • Loading branch information
Yan, Zheng committed Apr 27, 2014
1 parent 70ab079 commit 3e41f92
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2090,15 +2090,21 @@ void Client::kick_requests_closed(MetaSession *session)
{
ldout(cct, 10) << "kick_requests_closed for mds." << session->mds_num << dendl;
for (map<ceph_tid_t, MetaRequest*>::iterator p = mds_requests.begin();
p != mds_requests.end();
++p) {
if (p->second->mds == session->mds_num) {
if (p->second->caller_cond) {
p->second->kick = true;
p->second->caller_cond->Signal();
p != mds_requests.end(); ) {
MetaRequest *req = p->second;
++p;
if (req->mds == session->mds_num) {
if (req->caller_cond) {
req->kick = true;
req->caller_cond->Signal();
}
req->item.remove_myself();
if (req->got_unsafe) {
lderr(cct) << "kick_requests_closed removing unsafe request " << req->get_tid() << dendl;
req->unsafe_item.remove_myself();
mds_requests.erase(req->get_tid());
put_request(req);
}
p->second->item.remove_myself();
p->second->unsafe_item.remove_myself();
}
}
assert(session->requests.empty());
Expand Down

0 comments on commit 3e41f92

Please sign in to comment.