diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index c4aa37782531b..db08ea6bfdb0f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -2759,6 +2759,7 @@ private HdfsFileStatus startFileInt(String src, long blockSize, CryptoProtocolVersion[] supportedVersions, String ecPolicyName, String storagePolicy, boolean logRetryCache) throws IOException { + final String operationName = "create"; if (NameNode.stateChangeLog.isDebugEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("DIR* NameSystem.startFile: src=").append(src) @@ -2796,6 +2797,7 @@ private HdfsFileStatus startFileInt(String src, checkOperation(OperationCategory.WRITE); final FSPermissionChecker pc = getPermissionChecker(); + FSPermissionChecker.setOperationType(operationName); writeLock(RwLockMode.FS); try { checkOperation(OperationCategory.WRITE); @@ -2858,7 +2860,7 @@ private HdfsFileStatus startFileInt(String src, dir.writeUnlock(); } } finally { - writeUnlock(RwLockMode.FS, "create", + writeUnlock(RwLockMode.FS, operationName, getLockReportInfoSupplier(src, null, stat)); // There might be transactions logged while trying to recover the lease. // They need to be sync'ed even when an exception was thrown. @@ -3255,7 +3257,7 @@ INodeFile checkLease(INodesInPath iip, String holder, long fileId) */ boolean completeFile(final String src, String holder, ExtendedBlock last, long fileId) - throws IOException { + throws IOException { boolean success = false; final String operationName = "completeFile"; checkOperation(OperationCategory.WRITE);