|
@@ -2156,13 +2156,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) {
|
|
@@ -2188,13 +2188,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) {
|
|
@@ -2324,13 +2324,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) {
|
|
@@ -2353,13 +2353,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) {
|
|
@@ -2397,7 +2397,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);
|
|
@@ -2406,7 +2406,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();
|
|
@@ -2477,14 +2477,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);
|
|
@@ -2537,14 +2537,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) {
|
|
@@ -2571,14 +2571,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) {
|
|
@@ -2619,13 +2619,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) {
|
|
@@ -2648,12 +2648,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
- readLock();
|
|
|
+ readLock(FSNamesystemLockMode.FS);
|
|
|
try {
|
|
|
checkOperation(OperationCategory.READ);
|
|
|
return FSDirAttrOp.getStoragePolicy(dir, pc, blockManager, src);
|
|
|
} finally {
|
|
|
- readUnlock("getStoragePolicy");
|
|
|
+ readUnlock(FSNamesystemLockMode.FS, operationName);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2663,12 +2663,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");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2935,7 +2935,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()) {
|
|
|
//
|
|
@@ -3280,7 +3280,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));
|
|
@@ -3633,12 +3633,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);
|
|
@@ -3671,14 +3671,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);
|
|
@@ -5882,7 +5883,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);
|
|
@@ -8019,13 +8020,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) {
|
|
@@ -8044,13 +8045,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) {
|
|
@@ -8068,13 +8069,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) {
|
|
@@ -8092,13 +8093,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) {
|
|
@@ -8116,13 +8117,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) {
|
|
@@ -8140,12 +8141,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);
|
|
@@ -8212,7 +8213,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
|
|
@@ -8220,7 +8221,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) {
|
|
@@ -8237,7 +8238,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 =
|
|
@@ -8245,7 +8246,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);
|
|
|
}
|
|
|
}
|
|
@@ -8274,7 +8275,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 =
|
|
@@ -8282,7 +8283,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);
|
|
|
}
|
|
|
}
|
|
@@ -8305,7 +8306,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
|
|
@@ -8337,7 +8338,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();
|
|
|
}
|
|
@@ -8663,14 +8665,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) {
|
|
@@ -8689,12 +8691,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);
|
|
@@ -8711,12 +8713,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);
|
|
@@ -8734,14 +8736,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) {
|