From 4167c5dd4a6d277c5b4cb2810ad5fbb059ff3deb Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 18 Dec 2020 11:02:29 -0500 Subject: [PATCH] librbd: ensure stripe unit is at least 512 bytes Fixes: https://tracker.ceph.com/issues/47828 Signed-off-by: Jason Dillaman --- src/librbd/image/CreateRequest.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librbd/image/CreateRequest.cc b/src/librbd/image/CreateRequest.cc index abf434920945a..b4cad77a3055b 100644 --- a/src/librbd/image/CreateRequest.cc +++ b/src/librbd/image/CreateRequest.cc @@ -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; } -- 2.39.5