Skip to content

Commit

Permalink
fix calculation of summary table in provisioner (#949) (#950)
Browse files Browse the repository at this point in the history
Signed-off-by: guochao <[email protected]>
  • Loading branch information
aravindavk committed Dec 29, 2022
1 parent df70c7f commit db7f718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csi/volumeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def mount_and_select_hosting_volume(pv_hosting_volumes, required_size):
# file not exists even in case of ENOTCONN
mntdir_stat = retry_errors(os.statvfs, [mntdir], [ENOTCONN])
with SizeAccounting(hvol, mntdir) as acc:
acc.update_summary(mntdir_stat.f_bavail * mntdir_stat.f_bsize)
acc.update_summary(mntdir_stat.f_blocks * mntdir_stat.f_bsize)
pv_stats = acc.get_stats()
reserved_size = pv_stats["free_size_bytes"] * RESERVED_SIZE_PERCENTAGE/100

Expand Down Expand Up @@ -436,7 +436,7 @@ def is_hosting_volume_free(hostvol, requested_pvsize):
# file not exists even in case of ENOTCONN
mntdir_stat = retry_errors(os.statvfs, [mntdir], [ENOTCONN])
with SizeAccounting(hostvol, mntdir) as acc:
acc.update_summary(mntdir_stat.f_bavail * mntdir_stat.f_bsize)
acc.update_summary(mntdir_stat.f_blocks * mntdir_stat.f_bsize)
pv_stats = acc.get_stats()
reserved_size = pv_stats["free_size_bytes"] * RESERVED_SIZE_PERCENTAGE/100

Expand Down

0 comments on commit db7f718

Please sign in to comment.