clang-tidy original warning:
/home/suyash/ceph/src/cls/queue/cls_queue_src.cc:330:50: warning: 'bl' used after it was moved [bugprone-use-after-move]
uint64_t entry_start_offset = start_offset - bl.length();
^
/home/suyash/ceph/src/cls/queue/cls_queue_src.cc:333:14: note: move occurred here
bl_chunk = std::move(bl);
^
/home/suyash/ceph/src/cls/queue/cls_queue_src.cc:330:50: note: the use happens in a later loop iteration than the move
uint64_t entry_start_offset = start_offset - bl.length();
^
Fixes: https://tracker.ceph.com/issues/66356
Signed-off-by: Suyash Dongre <suyashd999@gmail.com>
}
//If there is leftover data from previous iteration, append new data to leftover data
- uint64_t entry_start_offset = start_offset - bl.length();
+ uint64_t entry_start_offset = start_offset - bl.length(); //NOLINT(bugprone-use-after-move)
CLS_LOG(20, "INFO: queue_list_entries(): Entry start offset accounting for leftover data is %lu", entry_start_offset);
bl.claim_append(bl_chunk);
bl_chunk = std::move(bl);
-
+ bl.clear(); //NOLINT(bugprone-use-after-move)
CLS_LOG(20, "INFO: queue_list_entries(): size of chunk %u", bl_chunk.length());
//Process the chunk of data read