silence warnings like:
src/librbd/io/ImageRequestWQ.cc:576:7: warning: 'length' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (block_overlapping_io(&m_in_flight_extents, offset, length)) {
^~
...
src/librbd/io/ImageRequestWQ.cc:935:12: note: 'length' was declared here
uint64_t length;
^~~~~~
Signed-off-by: Kefu Chai <kchai@redhat.com>
const auto& extents = req->get_image_extents();
bool write_op = req->is_write_op();
uint64_t tid = req->get_tid();
- uint64_t offset;
- uint64_t length;
+ uint64_t offset = 0;
+ uint64_t length = 0;
if (write_op) {
std::lock_guard locker{m_lock};