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

Missing null check in INodeFile#getBlocks()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: