Repository: hadoop
Updated Branches:
  refs/heads/branch-2 def7490b2 -> 8aa12772d


HDFS-6885. Fix wrong use of BytesWritable in FSEditLogOp#RenameOp. Contributed 
by Yi Liu.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8aa12772
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8aa12772
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8aa12772

Branch: refs/heads/branch-2
Commit: 8aa12772d460bacc87ba672310990d2253d12016
Parents: def7490
Author: Haohui Mai <[email protected]>
Authored: Sun Nov 22 17:16:51 2015 -0800
Committer: Haohui Mai <[email protected]>
Committed: Sun Nov 22 17:17:01 2015 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                     | 3 +++
 .../org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java     | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8aa12772/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index f3ec788..fb194de 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1487,6 +1487,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-8914. Document HA support in the HDFS HdfsDesign.md.
     (Lars Francke via wheat9)
 
+    HDFS-6885. Fix wrong use of BytesWritable in FSEditLogOp#RenameOp.
+    (Yi Liu via wheat9)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8aa12772/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
index 45a809e..fd0c82c 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
@@ -2707,9 +2707,10 @@ public abstract class FSEditLogOp {
       writable.readFields(in);
 
       byte[] bytes = writable.getBytes();
-      Rename[] options = new Rename[bytes.length];
+      int len = writable.getLength();
+      Rename[] options = new Rename[len];
 
-      for (int i = 0; i < bytes.length; i++) {
+      for (int i = 0; i < len; i++) {
         options[i] = Rename.valueOf(bytes[i]);
       }
       return options;

Reply via email to