cephfs: round to cephfs size to multiple of 4Mib#3241
cephfs: round to cephfs size to multiple of 4Mib#3241mergify[bot] merged 1 commit intoceph:develfrom
Conversation
nixpanic
left a comment
There was a problem hiding this comment.
Looks correct to me, round up to a multiple of 4 MiB. Implementation could be a little clearer, as it required me to track each step for verification.
| return 4 * helpers.MiB | ||
| } | ||
|
|
||
| bytes /= helpers.MiB |
There was a problem hiding this comment.
this naming is confusing, these are not bytes anymore, but MiBs
|
|
||
| bytes /= helpers.MiB | ||
|
|
||
| bytes = int64(math.Ceil(float64(bytes)/4) * 4) |
There was a problem hiding this comment.
ok, multiple steps at once:
- convert to float
- divide MiBs by 4 (4.8 / 4 = 1.2)
- round upwards (1.2 => 2)
- multiply by four again (2 * 4 = 8)
- convert back to int
seems to be correct
|
|
||
| bytes = int64(math.Ceil(float64(bytes)/4) * 4) | ||
|
|
||
| return RoundOffBytes(bytes * helpers.MiB) |
There was a problem hiding this comment.
convert bytes (in MiB) back to bytes
|
@Mergifyio rebase |
|
CI is stuck, restarting tests with rebase |
✅ Branch has been successfully rebased |
|
@Mergifyio rebase |
Due to the bug in the df stat we need to round off the subvolume size to align with 4Mib. Note:- Minimum supported size in cephcsi is 1Mib, we dont need to take care of Kib. fixes ceph#3240 More details at ceph/ceph#46905 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
✅ Branch has been successfully rebased |
|
/retest ci/centos/mini-e2e-helm/k8s-1.22 |
|
/retest ci/centos/k8s-e2e-external-storage/1.22 |
|
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
|
/retest ci/centos/mini-e2e-helm/k8s-1.23 |
|
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
|
/retest ci/centos/k8s-e2e-external-storage/1.22 |
|
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
|
/retest ci/centos/k8s-e2e-external-storage/1.22 |
|
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
|
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
|
/retest ci/centos/k8s-e2e-external-storage/1.22 |
|
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
|
/retest ci/centos/k8s-e2e-external-storage/1.22 |
|
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
Due to the bug in the df stat we need to round off the subvolume size to align with 4Mib.
Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.
fixes #3240
More details at ceph/ceph#46905
Signed-off-by: Madhu Rajanna madhupr007@gmail.com
Logs with fix
3Mib PVC
4Mib PVC
1023 Mib PVC