This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6020505 HDFS-14915. Move Superuser Check Before Taking Lock For
Encryption API. Contributed by Ayush Saxena.
6020505 is described below
commit 6020505943fbb6133f7c2747e6d85d79cde788ea
Author: Ayush Saxena <[email protected]>
AuthorDate: Tue Oct 22 18:44:22 2019 +0530
HDFS-14915. Move Superuser Check Before Taking Lock For Encryption API.
Contributed by Ayush Saxena.
---
.../java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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 5d97593..5209b98 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
@@ -7437,10 +7437,10 @@ public class FSNamesystem implements Namesystem,
FSNamesystemMBean,
Metadata metadata = FSDirEncryptionZoneOp.ensureKeyIsInitialized(dir,
keyName, src);
final FSPermissionChecker pc = getPermissionChecker();
+ checkSuperuserPrivilege(pc);
checkOperation(OperationCategory.WRITE);
writeLock();
try {
- checkSuperuserPrivilege(pc);
checkOperation(OperationCategory.WRITE);
checkNameNodeSafeMode("Cannot create encryption zone on " + src);
resultingStat = FSDirEncryptionZoneOp.createEncryptionZone(dir, src,
@@ -7496,10 +7496,10 @@ public class FSNamesystem implements Namesystem,
FSNamesystemMBean,
boolean success = false;
checkOperation(OperationCategory.READ);
final FSPermissionChecker pc = getPermissionChecker();
+ checkSuperuserPrivilege(pc);
readLock();
try {
checkOperation(OperationCategory.READ);
- checkSuperuserPrivilege(pc);
final BatchedListEntries<EncryptionZone> ret =
FSDirEncryptionZoneOp.listEncryptionZones(dir, prevId);
success = true;
@@ -7533,10 +7533,10 @@ public class FSNamesystem implements Namesystem,
FSNamesystemMBean,
boolean success = false;
checkOperation(OperationCategory.READ);
final FSPermissionChecker pc = getPermissionChecker();
+ checkSuperuserPrivilege(pc);
readLock();
try {
checkOperation(OperationCategory.READ);
- checkSuperuserPrivilege(pc);
final BatchedListEntries<ZoneReencryptionStatus> ret =
FSDirEncryptionZoneOp.listReencryptionStatus(dir, prevId);
success = true;
@@ -7567,7 +7567,6 @@ public class FSNamesystem implements Namesystem,
FSNamesystemMBean,
}
writeLock();
try {
- checkSuperuserPrivilege(pc);
checkOperation(OperationCategory.WRITE);
checkNameNodeSafeMode("NameNode in safemode, cannot " + action
+ " re-encryption on zone " + zone);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]