From: Jason Dillaman Date: Fri, 18 Dec 2020 16:02:29 +0000 (-0500) Subject: librbd: ensure stripe unit is at least 512 bytes X-Git-Tag: v16.1.0~156^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4167c5dd4a6d277c5b4cb2810ad5fbb059ff3deb;p=ceph.git librbd: ensure stripe unit is at least 512 bytes Fixes: https://tracker.ceph.com/issues/47828 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/image/CreateRequest.cc b/src/librbd/image/CreateRequest.cc index abf434920945..b4cad77a3055 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; }