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

Missing null check in INodeFile#getBlocks()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.7.0
    • None
    • None
    • Reviewed

    Description

          BlockInfo[] snapshotBlocks = diff == null ? getBlocks() : diff.getBlocks();
          if(snapshotBlocks != null)
            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());
      

      If diff is null and snapshotBlocks is null, NullPointerException would result from the call to diff.getSnapshotId().

      Attachments

        1. HDFS-7606-1.patch
          2 kB
          Chen He
        2. HDFS-7606.patch
          1 kB
          Byron Wong
        3. HDFS-7606.patch
          0.9 kB
          Byron Wong

        Issue Links

          Activity

            People

              Byron Wong Byron Wong
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: