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
messages: initialize variable tid in MMDSFindIno #16793
Conversation
src/messages/MMDSFindIno.h
Outdated
@@ -22,7 +22,7 @@ struct MMDSFindIno : public Message { | |||
ceph_tid_t tid; | |||
inodeno_t ino; | |||
|
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.
I would initialize them here (guaranteed), which can be overridden by the initializer list if needed.
Jenkins restest this please |
@joscollin Thanks for comments. Done Changes. |
src/messages/MMDSFindIno.h
Outdated
ceph_tid_t tid; | ||
inodeno_t ino; | ||
ceph_tid_t tid = 0; | ||
inodeno_t ino = {0}; | ||
|
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.
nit: There is no need of =
if you do it this way {0}
. Change both lines to same method of initialization.
@joscollin Thanks for Comments. Done changes. |
src/messages/MMDSFindIno.h
Outdated
ceph_tid_t tid; | ||
inodeno_t ino; | ||
ceph_tid_t tid {0}; | ||
inodeno_t ino {0}; | ||
|
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.
There is no need of initializing ino
. See the definition of inodeno_t. By default it is initialized to 0
in the constructor.
@joscollin Done changes. Thanks for comments. |
Fixes the coverity Issue: ** 717286 Uninitialized scalar field CID 717286 (ceph#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member tid is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Amit Kumar amitkuma@redhat.com
Fixes the coverity Issue:
Signed-off-by: Amit Kumar amitkuma@redhat.com