From f78b6d47f9d5c05bd990aec3481e6cede93d43ea Mon Sep 17 00:00:00 2001 From: litao Date: Thu, 24 Jun 2021 18:29:42 +0800 Subject: [PATCH] HDFS-16085. Move the getPermissionChecker out of the read lock (#3134). Contributed by tomscut. Signed-off-by: Takanobu Asanuma Signed-off-by: Ayush Saxena --- .../org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java index a39648979c9..578c9ebb5a8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java @@ -574,10 +574,11 @@ public class NamenodeFsck implements DataEncryptionKeyFactory { final FSNamesystem fsn = namenode.getNamesystem(); final String operationName = "fsckGetBlockLocations"; FSPermissionChecker.setOperationType(operationName); + FSPermissionChecker pc = fsn.getPermissionChecker(); fsn.readLock(); try { blocks = FSDirStatAndListingOp.getBlockLocations( - fsn.getFSDirectory(), fsn.getPermissionChecker(), + fsn.getFSDirectory(), pc, path, 0, fileLen, false) .blocks; } catch (FileNotFoundException fnfe) {