client: Always cleanup request after safe

The client MetaRequest should always be cleaned up
and removed from the mds_requests map once the client
gets a safe reply.  This patch avoids a leak where the
mds does not send back an unsafe reply and the request
is never cleaned up.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
This commit is contained in:
Sam Lang 2013-03-25 11:43:54 -05:00
parent 4dda138b07
commit dfb46b9a32

View File

@ -1751,14 +1751,14 @@ void Client::handle_client_reply(MClientReply *reply)
if (is_safe) {
// the filesystem change is committed to disk
if (request->got_unsafe) {
// we're done, clean up
request->item.remove_myself();
if (request->got_unsafe) {
request->unsafe_item.remove_myself();
}
request->item.remove_myself();
mds_requests.erase(tid);
request->put(); // for the dumb data structure
}
}
if (unmounting)
mount_cond.Signal();
}