git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1492961 13f79535-47bb-0310-9956-ffa450edef68
@@ -350,6 +350,8 @@ Release 2.1.0-beta - UNRELEASED
HDFS-3163. TestHDFSCLI.testAll fails if the user name is not all lowercase.
(Brandon Li via atm)
+ HDFS-4845. FSNamesystem.deleteInternal should acquire write-lock before
+ changing the inode map. (Arpit Agarwal via szetszwo)
BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS
@@ -2916,7 +2916,12 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
getEditLog().logSync();
removeBlocks(collectedBlocks); // Incremental deletion of blocks
collectedBlocks.clear();
- dir.removeFromInodeMap(removedINodes);
+ dir.writeLock();
+ try {
+ dir.removeFromInodeMap(removedINodes);
+ } finally {
+ dir.writeUnlock();
+ }
removedINodes.clear();
if (NameNode.stateChangeLog.isDebugEnabled()) {
NameNode.stateChangeLog.debug("DIR* Namesystem.delete: "