From e843a0a8cee5c704a5d28cf14b5a4050094d341b Mon Sep 17 00:00:00 2001 From: Jing Zhao Date: Mon, 19 Jan 2015 10:28:29 -0800 Subject: [PATCH] HDFS-7637. Fix the check condition for reserved path. Contributed by Yi Liu. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 71e68c272e..e3d0ca89ac 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -725,6 +725,8 @@ Release 2.7.0 - UNRELEASED using more than 1 DataNode and more than 2 storage locations per DataNode. (cnauroth) + HDFS-7637. Fix the check condition for reserved path. (Yi Liu via jing9) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java index 61ef19fc58..c171448a1b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java @@ -1311,7 +1311,7 @@ public static boolean isReservedName(INode inode) { /** Check if a given path is reserved */ public static boolean isReservedName(String src) { - return src.startsWith(DOT_RESERVED_PATH_PREFIX); + return src.startsWith(DOT_RESERVED_PATH_PREFIX + Path.SEPARATOR); } static boolean isReservedRawName(String src) {