]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados.cc: fix pool alignment check 2020/head
authorSamuel Just <sam.just@inktank.com>
Tue, 24 Jun 2014 17:11:21 +0000 (10:11 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 25 Jun 2014 01:23:35 +0000 (18:23 -0700)
Only check pool alignment if io_ctx is initialized.

Introduced in 304b08a23a3db57010078046955a786fe3589ef8
Fixes: #8652
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/tools/rados/rados.cc

index 85a498b1918e26268b13fcfb124ab16de809db61..807b660b3f13dcf1c94234ccee2bc40a84778f3d 100644 (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?