diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3c33e36a2cc..790b0a62f34 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -487,6 +487,8 @@ Release 2.7.0 - UNRELEASED HDFS-7644. minor typo in HttpFS doc (Charles Lamb via aw) + HDFS-7606. Fix potential NPE in INodeFile.getBlocks(). (Byron Wong via shv) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java index 0bbfd7279a2..f4c27363bda 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java @@ -432,7 +432,7 @@ public class INodeFile extends INodeWithAdditionalFields return snapshotBlocks; // Blocks are not in the current snapshot // Find next snapshot with blocks present or return current file blocks - snapshotBlocks = getDiffs().findLaterSnapshotBlocks(diff.getSnapshotId()); + snapshotBlocks = getDiffs().findLaterSnapshotBlocks(snapshot); return (snapshotBlocks == null) ? getBlocks() : snapshotBlocks; }