New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: fix request reference leak #17545
Conversation
if request gets aborted, its reference leaks. Fixes: http://tracker.ceph.com/issues/21274 Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
@@ -1731,6 +1731,7 @@ int Client::make_request(MetaRequest *request, | |||
r = request->get_abort_code(); | |||
request->item.remove_myself(); | |||
unregister_request(request); | |||
put_request(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't unregister_request
also do put_request
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both mds_requests map and caller of make_reuqets() hold a reference. unregister_request() releases reference hold by mds_requests map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, my bad =( introduced by 9cb7906. it's a "potential" use-after-free.
* refs/remotes/upstream/pull/17545/head: client: fix request reference leak Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
* refs/remotes/upstream/pull/17545/head: client: fix request reference leak Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
if request gets aborted, its reference leaks.
Fixes: http://tracker.ceph.com/issues/21274
Signed-off-by: "Yan, Zheng" zyan@redhat.com