HDFS-6810. StorageReport array is initialized with wrong size in DatanodeDescriptor#getStorageReports. (Contributed by szetszwo)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1615381 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-08-03 02:08:32 +00:00
parent c614ceed84
commit bcf7ab1d0f
2 changed files with 3 additions and 1 deletions

View File

@ -427,6 +427,8 @@ Release 2.6.0 - UNRELEASED
HDFS-6797. DataNode logs wrong layoutversion during upgrade. (Benoy Antony HDFS-6797. DataNode logs wrong layoutversion during upgrade. (Benoy Antony
via Arpit Agarwal) via Arpit Agarwal)
HDFS-6810. StorageReport array is initialized with wrong size in
DatanodeDescriptor#getStorageReports. (szetszwo via Arpit Agarwal)
Release 2.5.0 - UNRELEASED Release 2.5.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -260,8 +260,8 @@ public class DatanodeDescriptor extends DatanodeInfo {
} }
public StorageReport[] getStorageReports() { public StorageReport[] getStorageReports() {
final StorageReport[] reports = new StorageReport[storageMap.size()];
final DatanodeStorageInfo[] infos = getStorageInfos(); final DatanodeStorageInfo[] infos = getStorageInfos();
final StorageReport[] reports = new StorageReport[infos.length];
for(int i = 0; i < infos.length; i++) { for(int i = 0; i < infos.length; i++) {
reports[i] = infos[i].toStorageReport(); reports[i] = infos[i].toStorageReport();
} }