diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java index d2dc90ec526..5acc3c04279 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java @@ -86,7 +86,7 @@ public class ReplicaCachingGetSpaceUsed extends FSCachingGetSpaceUsed { for (ReplicaInfo replicaInfo : replicaInfos) { if (Objects.equals(replicaInfo.getVolume().getStorageID(), volume.getStorageID())) { - dfsUsed += replicaInfo.getBlockDataLength(); + dfsUsed += replicaInfo.getBytesOnDisk(); dfsUsed += replicaInfo.getMetadataLength(); count++; }