Fix default value of parameter 'location'.
It should consist of one element BDEV_LABEL_POSITION (0),
not just create with size 0.
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit
28dbacf1745b8a5a63b22639e6730a9559b354b7)
}
bl.rebuild_aligned_size_and_memory(BDEV_LABEL_BLOCK_SIZE, BDEV_LABEL_BLOCK_SIZE, IOV_MAX);
int r = 0;
- if (std::find(locations.begin(), locations.end(), BDEV_LABEL_POSITION) ==
- locations.end()) {
- locations.push_back(BDEV_LABEL_POSITION);
- }
+ ceph_assert(locations.size() > 0);
struct stat st;
r = ::fstat(fd, &st);
if (r < 0) {
CephContext* cct,
const std::string &path,
bluestore_bdev_label_t label,
- std::vector<uint64_t> locations = std::vector<uint64_t>(BDEV_LABEL_POSITION));
+ std::vector<uint64_t> locations = std::vector<uint64_t>({BDEV_LABEL_POSITION}));
static int _read_bdev_label(
CephContext* cct, const std::string &path,
bluestore_bdev_label_t *label, uint64_t disk_position = BDEV_LABEL_POSITION);