1
0
Переглянути джерело

HDFS-686. NullPointerException is thrown while merging edit log and image. Contributed by Hairong Kuang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@824957 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 роки тому
батько
коміт
cf41db9ca4

+ 3 - 0
CHANGES.txt

@@ -17,6 +17,9 @@ Release 0.20.2 - Unreleased
     values of new configuration variables when deprecated variables are
     values of new configuration variables when deprecated variables are
     disabled. (Sreekanth Ramakrishnan via yhemanth)
     disabled. (Sreekanth Ramakrishnan via yhemanth)
 
 
+    HDFS-686. NullPointerException is thrown while merging edit log and image.
+    (hairong)
+
 Release 0.20.1 - 2009-09-01
 Release 0.20.1 - 2009-09-01
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 2 - 2
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -759,7 +759,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
     if (length < 0) {
     if (length < 0) {
       throw new IOException("Negative length is not supported. File: " + src );
       throw new IOException("Negative length is not supported. File: " + src );
     }
     }
-    final LocatedBlocks ret = getBlockLocationsInternal(src, dir.getFileINode(src),
+    final LocatedBlocks ret = getBlockLocationsInternal(src, 
         offset, length, Integer.MAX_VALUE, doAccessTime);  
         offset, length, Integer.MAX_VALUE, doAccessTime);  
     if (auditLog.isInfoEnabled()) {
     if (auditLog.isInfoEnabled()) {
       logAuditEvent(UserGroupInformation.getCurrentUGI(),
       logAuditEvent(UserGroupInformation.getCurrentUGI(),
@@ -770,12 +770,12 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
   }
   }
 
 
   private synchronized LocatedBlocks getBlockLocationsInternal(String src,
   private synchronized LocatedBlocks getBlockLocationsInternal(String src,
-                                                       INodeFile inode,
                                                        long offset, 
                                                        long offset, 
                                                        long length,
                                                        long length,
                                                        int nrBlocksToReturn,
                                                        int nrBlocksToReturn,
                                                        boolean doAccessTime) 
                                                        boolean doAccessTime) 
                                                        throws IOException {
                                                        throws IOException {
+    INodeFile inode = dir.getFileINode(src);
     if(inode == null) {
     if(inode == null) {
       return null;
       return null;
     }
     }