]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
enforce rados put aligment
authorLluis Pamies-Juarez <lluis@pamies.cat>
Wed, 18 Jun 2014 17:00:09 +0000 (10:00 -0700)
committerSage Weil <sage@redhat.com>
Fri, 1 Aug 2014 22:53:03 +0000 (15:53 -0700)
Signed-off-by: Lluis Pamies-Juarez <lluis.pamies-juarez@hgst.com>
(cherry picked from commit 304b08a23a3db57010078046955a786fe3589ef8)
(cherry picked from commit dece65064d949b5afcc359cd408615883b5e002a)

src/tools/rados/rados.cc

index bd71433e8dc363609008736c40c353682a4c555b..7249d5eef6b15cba5244eb45bdb0d1ad177ac1bf 100644 (file)
@@ -1370,6 +1370,15 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     }
   }
 
+  // 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 << "WARNING: op_size has been rounded to " << op_size << std::endl;
+  }
+
   // snapname?
   if (snapname) {
     ret = io_ctx.snap_lookup(snapname, &snapid);