Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11476

Fix NPE in FsDatasetImpl#checkAndUpdate

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha4
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      diskMetaFile can be null and passed to compareTo which dereferences it, causing NPE

      // Compare generation stamp
            if (memBlockInfo.getGenerationStamp() != diskGS) {
              File memMetaFile = FsDatasetUtil.getMetaFile(diskFile, 
                  memBlockInfo.getGenerationStamp());
              if (memMetaFile.exists()) {
                if (memMetaFile.compareTo(diskMetaFile) != 0) {
                  LOG.warn("Metadata file in memory "
                      + memMetaFile.getAbsolutePath()
                      + " does not match file found by scan "
                      + (diskMetaFile == null? null: diskMetaFile.getAbsolutePath()));
                }
              } else {
      

        Attachments

        1. HDFS-11476.000.patch
          2 kB
          Xiaobing Zhou
        2. HDFS-11476.001.patch
          2 kB
          Xiaobing Zhou
        3. HDFS-11476.002.patch
          2 kB
          Xiaobing Zhou
        4. HDFS-11476.003.patch
          2 kB
          Xiaobing Zhou

          Activity

            People

            • Assignee:
              xiaobingo Xiaobing Zhou
              Reporter:
              xiaobingo Xiaobing Zhou
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: