Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/client: diskcache division by zero #1591

Closed
h0hmj opened this issue Jun 17, 2022 · 0 comments
Closed

curvefs/client: diskcache division by zero #1591

h0hmj opened this issue Jun 17, 2022 · 0 comments
Assignees
Labels
bug Something isn't working high high priority need test Completion of development, requires QA verification

Comments

@h0hmj
Copy link
Contributor

h0hmj commented Jun 17, 2022

Describe the bug (描述bug)

int64_t DiskCacheManager::SetDiskFsUsedRatio() {

using statfs to get info, but sometime usedBytes and availableBytes will be zero both, cause division by zero.
int64_t usedPercent = 100 * usedBytes / (usedBytes + availableBytes) + 1;

some systems do not implement statfs, so data may be incorrect.

To Reproduce (复现方法)

using 9p mount local dir to minikube (minikube mount), then run curve-fuse with diskcache enable in minikube, will core dump because of division by zero

related issue
kubernetes/minikube#3794

Expected behavior (期望行为)

No Coredump but Error Log and exit correctly

@h0hmj h0hmj added the bug Something isn't working label Jun 17, 2022
@Wine93 Wine93 added the high high priority label Jun 20, 2022
@wuhongsong wuhongsong added the need test Completion of development, requires QA verification label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high high priority need test Completion of development, requires QA verification
Projects
None yet
Development

No branches or pull requests

3 participants