Explorar o código

HADOOP-1136. Fix ArrayIndexOutOfBoundsException in FSNamesystem add() method. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@527409 13f79535-47bb-0310-9956-ffa450edef68
Thomas White %!s(int64=18) %!d(string=hai) anos
pai
achega
c02cb49e80
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  1. 4 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 4 - 0
CHANGES.txt

@@ -147,6 +147,10 @@ Trunk (unreleased changes)
 45. HADOOP-1211.  Remove deprecated constructor and unused static 
     members in DataNode class.  (Konstantin Shvachko via tomwhite)
 
+46. HADOOP-1136.  Fix ArrayIndexOutOfBoundsException in 
+    FSNamesystem$UnderReplicatedBlocks add() method.  
+    (Hairong Kuang via tomwhite)
+
 
 Release 0.12.3 - 2007-04-06
 

+ 1 - 1
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -463,7 +463,7 @@ class FSNamesystem implements FSConstants {
          */
         synchronized boolean add(
             Block block, int curReplicas, int expectedReplicas) {
-            if(expectedReplicas <= curReplicas) {
+            if(curReplicas<=0 || expectedReplicas <= curReplicas) {
                 return false;
             }
             int priLevel = getPriority(block, curReplicas, expectedReplicas);