[pve-devel] [PATCH storage 2/2] rbd: volume resize: avoid passing floating point value to rbd

Fiona Ebner f.ebner at proxmox.com
Wed Jun 7 10:51:17 CEST 2023


Am 06.06.23 um 19:37 schrieb Thomas Lamprecht:
> Am 28/04/2023 um 14:32 schrieb Fiona Ebner:
>>  
>> -    my $cmd = $rbd_cmd->($scfg, $storeid, 'resize', '--size', ($size/1024/1024), $name);
>> +    my $cmd = $rbd_cmd->($scfg, $storeid, 'resize', '--size', ceil($size/1024/1024), $name);
> 
> 
> Hmm, but POSIX ceil is also returning a double `double ceil(double x)`, maybe wrap
> that into an int(), hedging against (future) perl is often a relatively good idea ^^

Thanks! While testing worked, it does seem a bit brittle without the int().

> 
> FWIW: we often to something like int(($size + 1023)/1024/1024); (untested for this
> specific case).
> 

This would also have avoided the new "use" statement, will go for that
next time.





More information about the pve-devel mailing list