Merge pull request #38655 from dillaman/wip-47828

librbd: ensure stripe unit is at least 512 bytes

Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2020-12-30 16:15:47 +02:00 committed by GitHub
commit 1bfac6181a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;
}