Ted Yu created HDFS-7538: ---------------------------- Summary: removedDst should be checked against null in the finally block of FSDirRenameOp#unprotectedRenameTo() Key: HDFS-7538 URL: https://issues.apache.org/jira/browse/HDFS-7538 Project: Hadoop HDFS Issue Type: Bug Reporter: Ted Yu Priority: Minor
{code} if (removedDst != null) { undoRemoveDst = false; ... if (undoRemoveDst) { // Rename failed - restore dst if (dstParent.isDirectory() && dstParent.asDirectory().isWithSnapshot()) { dstParent.asDirectory().undoRename4DstParent(removedDst, {code} If the first if check doesn't pass, removedDst would be null and undoRemoveDst may be true. This combination would lead to NullPointerException in the finally block. -- This message was sent by Atlassian JIRA (v6.3.4#6332)