Details
Description
public long getNonDfsUsed() throws IOException { long actualNonDfsUsed = getActualNonDfsUsed(); if (actualNonDfsUsed < reserved) { return 0L; } return actualNonDfsUsed - reserved; }
The code block above is the function to caculate nonDfsUsed, but in fact it will let the result to be 0L out of expect. Such as this following situation:
du.reserved = 50G
Disk Capacity = 2048G
Disk Available = 2000G
Dfs used = 30G
usage.getUsed() = dirFile.getTotalSpace() - dirFile.getFreeSpace()
= 2048G - 2000G
= 48G
getActualNonDfsUsed = usage.getUsed() - getDfsUsed()
= 48G - 30G
= 18G
18G < 50G, so the function `getNonDfsUsed` actualNonDfsUsed < reserved, and the NonDfsUsed will return 0, is that logic make sense?