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
hammer: osd: FileStore: potential memory leak if getattrs fails. #6420
Conversation
Memory leak happens if _fgetattrs encounters some error and simply returns. Fixes: ceph#13597 Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn> (cherry picked from commit ace7dd0)
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
@@ -3780,6 +3780,7 @@ int FileStore::_fgetattrs(int fd, map<string,bufferptr>& aset) | |||
dout(10) << " -ERANGE, got " << len << dendl; | |||
if (len < 0) { | |||
assert(!m_filestore_fail_eio || len != -EIO); | |||
delete[] names2; |
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.
May be it's better to use std::unique_ptr to avoid the same issue if code changes?
@xiexingguo Please note the question at #6420 (comment) |
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
…s fails. Reviewed-by: Loic Dachary <ldachary@redhat.com>
@tchaikov does this backport look good to merge ? It passed a run of the hammer rados suite ( see http://tracker.ceph.com/issues/13356#note-28 for details ). |
@dachary lgtm. |
FileStore: potential memory leak if getattrs fails. Reviewed-by: Kefu Chai <kchai@redhat.com>
http://tracker.ceph.com/issues/13637