Bug #3688
closedrbd allows image of size 0 to be created
0%
Description
ceph version : 0.55.1-360-g6356739 (635673928a6b4dae6d4712cacad81cbac6412dc3)
rbd allows images created with zero size. While trying to create images with inappropriate values[like -1], the error message "rbd: size must be >= 0" thrown is misleading. It should be "rbd: size must be > 0".
Same applies to rbd images created with --new-format tag
ubuntu@burnupi15:~$ rbd create image --size 0
ubuntu@burnupi15:~$ rbd info image
rbd image 'image':
size 0 bytes in 0 objects
order 22 (4096 KB objects)
block_name_prefix: rb.0.1276.6b8b4567
format: 1
ubuntu@burnupi15:~$ rbd create image_neg --size -1
rbd: size must be >= 0
ubuntu@burnupi15:~$ rbd create imgg --size 0 --new-format
ubuntu@burnupi15:~$ rbd info imgg
rbd image 'imgg':
size 0 bytes in 0 objects
order 22 (4096 KB objects)
block_name_prefix: rbd_data.12456b8b4567
format: 2
features: layering, striping
stripe unit: 4096 KB
stripe count: 1