From d7350a3741bf4cdb270c6361e68090fe280cf36d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 24 Jun 2014 10:11:21 -0700 Subject: [PATCH] rados.cc: fix pool alignment check Only check pool alignment if io_ctx is initialized. Introduced in 304b08a23a3db57010078046955a786fe3589ef8 Fixes: #8652 Signed-off-by: Samuel Just --- src/tools/rados/rados.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc index 85a498b1918e..807b660b3f13 100644 --- a/src/tools/rados/rados.cc +++ b/src/tools/rados/rados.cc @@ -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? -- 2.47.3