Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6551

Rename with OVERWRITE option may throw NPE when the target file/directory is a reference INode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: namenode, snapshots
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The following steps can reproduce the NPE:
      1. create a snapshot on /
      2. move /foo/file1 to /bar/
      3. rename /foo/file2 to /bar/file1 with the OVERWRITE option

      After step 2, /bar/file1 is a DstReference inode. In step 3, FSDirectory#unprotectedRename first detaches the DstReference inode from the WithCount inode, then it still calls the cleanSubtree method of the corresponding INodeFile instance, which triggers the NPE. We should follow the same logic in FSDirectory#unprotectedDelete which skips the cleanSubtree call in this scenario.

        Activity

        Jing Zhao created issue -
        Jing Zhao made changes -
        Field Original Value New Value
        Summary Rename with OVERWRITE may throw NPE when the target file/directory is a reference INode Rename with OVERWRITE option may throw NPE when the target file/directory is a reference INode
        Jing Zhao made changes -
        Attachment HDFS-6551.000.patch [ 12650728 ]
        Jing Zhao made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Tsz Wo Nicholas Sze made changes -
        Hadoop Flags Reviewed [ 10343 ]
        Component/s namenode [ 12312926 ]
        Component/s snapshots [ 12320700 ]
        Jing Zhao made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 2.5.0 [ 12326264 ]
        Resolution Fixed [ 1 ]
        Karthik Kambatla (Inactive) made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jing Zhao
            Reporter:
            Jing Zhao
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development