mirror of
https://github.com/ceph/ceph
synced 2025-01-18 09:02:08 +00:00
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:
parent
235f4ca6dc
commit
d7350a3741
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user