rados.cc: fix pool alignment check

Only check pool alignment if io_ctx is initialized.

Introduced in 304b08a23a
Fixes: #8652
Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-06-24 10:11:21 -07:00
parent 235f4ca6dc
commit d7350a3741

View File

@ -1359,15 +1359,15 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
<< cpp_strerror(ret) << std::endl;
goto out;
}
}
// align op_size
if (io_ctx.pool_requires_alignment()) {
const uint64_t align = io_ctx.pool_required_alignment();
const bool wrn = (op_size != (1<<22));
op_size = uint64_t((op_size + align - 1) / align) * align;
if (wrn)
cerr << "INFO: op_size has been rounded to " << op_size << std::endl;
// align op_size
if (io_ctx.pool_requires_alignment()) {
const uint64_t align = io_ctx.pool_required_alignment();
const bool wrn = (op_size != (1<<22));
op_size = uint64_t((op_size + align - 1) / align) * align;
if (wrn)
cerr << "INFO: op_size has been rounded to " << op_size << std::endl;
}
}
// snapname?