|
@@ -2150,13 +2150,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set permission for " + src);
|
|
|
auditStat = FSDirAttrOp.setPermission(dir, pc, src, permission);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2182,13 +2182,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set owner for " + src);
|
|
|
auditStat = FSDirAttrOp.setOwner(dir, pc, src, username, group);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2318,13 +2318,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
String srcsStr = Arrays.toString(srcs);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.GLOBAL);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot concat " + target);
|
|
|
stat = FSDirConcatOp.concat(dir, pc, target, srcs, logRetryCache);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.GLOBAL, operationName,
|
|
|
getLockReportInfoSupplier(srcsStr, target, stat));
|
|
|
}
|
|
|
} catch (AccessControlException ace) {
|
|
@@ -2347,13 +2347,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set times " + src);
|
|
|
auditStat = FSDirAttrOp.setTimes(dir, pc, src, mtime, atime);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2391,7 +2391,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.GLOBAL);
|
|
|
BlocksMapUpdateInfo toRemoveBlocks = new BlocksMapUpdateInfo();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -2400,7 +2400,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
clientMachine, mtime, toRemoveBlocks, pc);
|
|
|
} finally {
|
|
|
status = r != null ? r.getFileStatus() : null;
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.GLOBAL, operationName,
|
|
|
getLockReportInfoSupplier(src, null, status));
|
|
|
}
|
|
|
getEditLog().logSync();
|
|
@@ -2471,14 +2471,14 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.GLOBAL);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set replication for " + src);
|
|
|
success = FSDirAttrOp.setReplication(dir, pc, blockManager, src,
|
|
|
replication);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ writeUnlock(FSNamesystemLockMode.GLOBAL, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -2531,14 +2531,14 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
FileStatus auditStat = null;
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set storage policy for " + src);
|
|
|
auditStat = FSDirAttrOp.setStoragePolicy(dir, pc, blockManager, src,
|
|
|
policyName);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2565,14 +2565,14 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FileStatus auditStat = null;
|
|
|
validateStoragePolicySatisfy();
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot satisfy storage policy for " + src);
|
|
|
auditStat = FSDirSatisfyStoragePolicyOp.satisfyStoragePolicy(
|
|
|
dir, blockManager, src, logRetryCache);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2613,13 +2613,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
FileStatus auditStat = null;
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot unset storage policy for " + src);
|
|
|
auditStat = FSDirAttrOp.unsetStoragePolicy(dir, pc, blockManager, src);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -2641,12 +2641,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(null);
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
return FSDirAttrOp.getStoragePolicy(dir, pc, blockManager, src);
|
|
|
} finally {
|
|
|
- readUnlock("getStoragePolicy");
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, "getStoragePolicy");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2656,12 +2656,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
*/
|
|
|
BlockStoragePolicy[] getStoragePolicies() throws IOException {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.BM);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
return FSDirAttrOp.getStoragePolicies(blockManager);
|
|
|
} finally {
|
|
|
- readUnlock("getStoragePolicies");
|
|
|
+ readUnlock(FSNamesystemLockMode.BM, "getStoragePolicies");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2925,7 +2925,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
boolean recoverLeaseInternal(RecoverLeaseOp op, INodesInPath iip,
|
|
|
String src, String holder, String clientMachine, boolean force)
|
|
|
throws IOException {
|
|
|
- assert hasWriteLock();
|
|
|
+ assert hasWriteLock(FSNamesystemLockMode.GLOBAL);
|
|
|
INodeFile file = iip.getLastINode().asFile();
|
|
|
if (file.isUnderConstruction()) {
|
|
|
//
|
|
@@ -3267,7 +3267,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
* @param blockType is the file under striping or contiguous layout?
|
|
|
*/
|
|
|
Block createNewBlock(BlockType blockType) throws IOException {
|
|
|
- assert hasWriteLock();
|
|
|
+ assert hasWriteLock(FSNamesystemLockMode.GLOBAL);
|
|
|
Block b = new Block(nextBlockId(blockType), 0, 0);
|
|
|
// Increment the generation stamp for every new block.
|
|
|
b.setGenerationStamp(nextGenerationStamp(false));
|
|
@@ -3620,12 +3620,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.GLOBAL);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
quotaUsage = FSDirStatAndListingOp.getQuotaUsage(dir, pc, src);
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ readUnlock(FSNamesystemLockMode.GLOBAL, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch (AccessControlException ace) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -3658,14 +3658,15 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkSuperuserPrivilege(operationName, src);
|
|
|
}
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ // Need to compute the curren space usage
|
|
|
+ writeLock(FSNamesystemLockMode.GLOBAL);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set quota on " + src);
|
|
|
FSDirAttrOp.setQuota(dir, pc, src, nsQuota, ssQuota, type,
|
|
|
allowOwnerSetQuota);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ writeUnlock(FSNamesystemLockMode.GLOBAL, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch (AccessControlException ace) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -5855,7 +5856,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
*/
|
|
|
long nextGenerationStamp(boolean legacyBlock)
|
|
|
throws IOException {
|
|
|
- assert hasWriteLock();
|
|
|
+ assert hasWriteLock(FSNamesystemLockMode.GLOBAL);
|
|
|
checkNameNodeSafeMode("Cannot get next generation stamp");
|
|
|
|
|
|
long gs = blockManager.nextGenerationStamp(legacyBlock);
|
|
@@ -7987,13 +7988,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot modify ACL entries on " + src);
|
|
|
auditStat = FSDirAclOp.modifyAclEntries(dir, pc, src, aclSpec);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8012,13 +8013,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot remove ACL entries on " + src);
|
|
|
auditStat = FSDirAclOp.removeAclEntries(dir, pc, src, aclSpec);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8036,13 +8037,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot remove default ACL entries on " + src);
|
|
|
auditStat = FSDirAclOp.removeDefaultAcl(dir, pc, src);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8060,13 +8061,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot remove ACL on " + src);
|
|
|
auditStat = FSDirAclOp.removeAcl(dir, pc, src);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8084,13 +8085,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set ACL on " + src);
|
|
|
auditStat = FSDirAclOp.setAcl(dir, pc, src, aclSpec);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8108,12 +8109,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
ret = FSDirAclOp.getAclStatus(dir, pc, src);
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch(AccessControlException ace) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -8180,7 +8181,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
try {
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
Entry<EncryptionZone, FileStatus> ezForPath = FSDirEncryptionZoneOp
|
|
@@ -8188,7 +8189,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
resultingStat = ezForPath.getValue();
|
|
|
encryptionZone = ezForPath.getKey();
|
|
|
} finally {
|
|
|
- readUnlock(operationName,
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(srcArg, null, resultingStat));
|
|
|
}
|
|
|
} catch (AccessControlException ace) {
|
|
@@ -8205,7 +8206,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
boolean success = false;
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
checkSuperuserPrivilege(operationName, dir.rootDir.getFullPathName());
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
final BatchedListEntries<EncryptionZone> ret =
|
|
@@ -8213,7 +8214,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
success = true;
|
|
|
return ret;
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(null));
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName, getLockReportInfoSupplier(null));
|
|
|
logAuditEvent(success, operationName, null);
|
|
|
}
|
|
|
}
|
|
@@ -8242,7 +8243,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
boolean success = false;
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
checkSuperuserPrivilege(operationName, dir.rootDir.getFullPathName());
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
final BatchedListEntries<ZoneReencryptionStatus> ret =
|
|
@@ -8250,7 +8251,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
success = true;
|
|
|
return ret;
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(null));
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName, getLockReportInfoSupplier(null));
|
|
|
logAuditEvent(success, operationName, null);
|
|
|
}
|
|
|
}
|
|
@@ -8273,7 +8274,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
LOG.info("Re-encryption using key version " + keyVersionName
|
|
|
+ " for zone " + zone);
|
|
|
}
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("NameNode in safemode, cannot " + action
|
|
@@ -8305,7 +8306,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
getEditLog().logSetXAttrs(zone, xattrs, logRetryCache);
|
|
|
}
|
|
|
} finally {
|
|
|
- writeUnlock(action + "reencryption", getLockReportInfoSupplier(zone));
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS,
|
|
|
+ action + "reencryption", getLockReportInfoSupplier(zone));
|
|
|
}
|
|
|
getEditLog().logSync();
|
|
|
}
|
|
@@ -8631,14 +8633,14 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot set XAttr on " + src);
|
|
|
auditStat = FSDirXAttrOp.setXAttr(dir, pc, src, xAttr, flag,
|
|
|
logRetryCache);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
@@ -8657,12 +8659,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
fsXattrs = FSDirXAttrOp.getXAttrs(dir, pc, src, xAttrs);
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -8679,12 +8681,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
fsXattrs = FSDirXAttrOp.listXAttrs(dir, pc, src);
|
|
|
} finally {
|
|
|
- readUnlock(operationName, getLockReportInfoSupplier(src));
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName, getLockReportInfoSupplier(src));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|
|
|
logAuditEvent(false, operationName, src);
|
|
@@ -8702,14 +8704,14 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
try {
|
|
|
- writeLock();
|
|
|
+ writeLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
|
checkNameNodeSafeMode("Cannot remove XAttr entry on " + src);
|
|
|
auditStat = FSDirXAttrOp.removeXAttr(dir, pc, src, xAttr,
|
|
|
logRetryCache);
|
|
|
} finally {
|
|
|
- writeUnlock(operationName,
|
|
|
+ writeUnlock(FSNamesystemLockMode.FS, operationName,
|
|
|
getLockReportInfoSupplier(src, null, auditStat));
|
|
|
}
|
|
|
} catch (AccessControlException e) {
|