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
rbd: Fix warning for uninitialized MirrorSnapshotNamespace::state #43396
Conversation
Fixes: https://tracker.ceph.com/issues/52753 Signed-off-by: Geetika Bangera <gbangera@cs.stonybrook.edu>
Found following warning while fixing https://tracker.ceph.com/issues/52753: [366/548] Building CXX object src/librbd/CMakeFiles/rbd_internal.dir/MirroringWatcher.cc.o In file included from ../src/librbd/MirroringWatcher.h:12, from ../src/librbd/MirroringWatcher.cc:4: ../src/librbd/mirroring_watcher/Types.h: In member function 'void librbd::MirroringWatcher<ImageCtxT>::handle_notify(uint64_t, uint64_t, uint64_t, ceph::bufferlist&) [with ImageCtxT = librbd::ImageCtx]': ../src/librbd/mirroring_watcher/Types.h:42:8: warning: '*((void*)(&<anonymous>)+8).librbd::mirroring_watcher::ImageUpdatedPayload::mirror_image_state' may be used uninitialized in this function [-Wmaybe-uninitialized] struct ImageUpdatedPayload { ^~~~~~~~~~~~~~~~~~~ Fixing this warning. Signed-off-by: Geetika Bangera <gbangera@cs.stonybrook.edu>
jenkins test make check |
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 don't quite understand why the old version produced the warnings.
It is not that I mind much, but the old way seemed prefered in modern Ceph world.
@tchaikov Have you any thoughts about this?
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 don't quite understand why the old version produced the warnings.
It is not that I mind much, but the old way seemed prefered in modern Ceph world.
Yeah, it doesn't make sense to revert to the old style, especially in the case of MirrorSnapshotNamespace
where state
would then be initialized in the constructor and complete
in the body. Maybe it's just CentOS 8's g++ version?
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
Looks like this warning is no longer there with a newer g++: |
Fixes: https://tracker.ceph.com/issues/52753
Signed-off-by: Geetika Bangera gbangera@cs.stonybrook.edu
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox