Sfoglia il codice sorgente

Fix potential FSImage corruption. Contributed by Ekanth Sethuramalingam & Arpit Agarwal.

(cherry picked from commit 0a1e922f3d8eca4e852be57124ec1bcafaadb289)
Konstantin V Shvachko 7 anni fa
parent
commit
b9c2cda844

+ 4 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/AclEntryStatusFormat.java

@@ -38,7 +38,8 @@ import com.google.common.collect.ImmutableList;
  * [1:3) -- the type of the entry (AclEntryType) <br>
  * [3:6) -- the permission of the entry (FsAction) <br>
  * [6:7) -- A flag to indicate whether Named entry or not <br>
- * [7:32) -- the name of the entry, which is an ID that points to a <br>
+ * [7:8) -- Reserved <br>
+ * [8:32) -- the name of the entry, which is an ID that points to a <br>
  * string in the StringTableSection. <br>
  */
 public enum AclEntryStatusFormat {
@@ -47,7 +48,8 @@ public enum AclEntryStatusFormat {
   TYPE(SCOPE.BITS, 2),
   PERMISSION(TYPE.BITS, 3),
   NAMED_ENTRY_CHECK(PERMISSION.BITS, 1),
-  NAME(NAMED_ENTRY_CHECK.BITS, 25);
+  RESERVED(NAMED_ENTRY_CHECK.BITS, 1),
+  NAME(RESERVED.BITS, 24);
 
   private final LongBitFormat BITS;
 

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeWithAdditionalFields.java

@@ -35,8 +35,8 @@ public abstract class INodeWithAdditionalFields extends INode
     implements LinkedElement {
   static enum PermissionStatusFormat {
     MODE(null, 16),
-    GROUP(MODE.BITS, 25),
-    USER(GROUP.BITS, 23);
+    GROUP(MODE.BITS, 24),
+    USER(GROUP.BITS, 24);
 
     final LongBitFormat BITS;