浏览代码

commit 6a75da8bf26fa428f8e04cd8ec723187cc462675
Author: Hairong Kuang <hairong@ucdev21.inktomisearch.com>
Date: Mon Oct 19 17:28:54 2009 +0000

HDFS:686 from http://issues.apache.org/jira/secure/attachment/12421668/openNPE.patch

+++ b/YAHOO-CHANGES.txt
+ HDFS-686. NullPointerException is thrown while merging edit log and
+ image. (hairong)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077025 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 年之前
父节点
当前提交
05d85b8b56
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

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

@@ -770,7 +770,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
     if (length < 0) {
       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);  
     if (auditLog.isInfoEnabled()) {
       logAuditEvent(UserGroupInformation.getCurrentUGI(),
@@ -781,12 +781,12 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
   }
 
   private synchronized LocatedBlocks getBlockLocationsInternal(String src,
-                                                       INodeFile inode,
                                                        long offset, 
                                                        long length,
                                                        int nrBlocksToReturn,
                                                        boolean doAccessTime) 
                                                        throws IOException {
+    INodeFile inode = dir.getFileINode(src);
     if(inode == null) {
       return null;
     }