]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ensure stripe unit is at least 512 bytes 38655/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2020 16:02:29 +0000 (11:02 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2020 16:06:01 +0000 (11:06 -0500)
Fixes: https://tracker.ceph.com/issues/47828
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/image/CreateRequest.cc

index abf434920945abeedd0100564a7a8d268aaa09b1..b4cad77a3055b2837b32c6413cee976cfdb463eb 100644 (file)
@@ -73,6 +73,9 @@ int validate_striping(CephContext *cct, uint8_t order, uint64_t stripe_unit,
   } else if (stripe_unit && ((1ull << order) % stripe_unit || stripe_unit > (1ull << order))) {
     lderr(cct) << "stripe unit is not a factor of the object size" << dendl;
     return -EINVAL;
+  } else if (stripe_unit != 0 && stripe_unit < 512) {
+    lderr(cct) << "stripe unit must be at least 512 bytes" << dendl;
+    return -EINVAL;
   }
   return 0;
 }