Преглед на файлове

HDFS-15396. Fix TestViewFileSystemOverloadSchemeHdfsFileSystemContract#testListStatusRootDir. Contributed by Ayush Saxena.

(cherry picked from commit a8610c15c498531bf3c011f1b0ace8eddddf61f2)
Ayush Saxena преди 5 години
родител
ревизия
b720d7770d
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java

+ 3 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java

@@ -1163,6 +1163,9 @@ public class ViewFileSystem extends FileSystem {
           INodeLink<FileSystem> link = (INodeLink<FileSystem>) inode;
           try {
             String linkedPath = link.getTargetFileSystem().getUri().getPath();
+            if("".equals(linkedPath)) {
+              linkedPath = "/";
+            }
             FileStatus status =
                 ((ChRootedFileSystem)link.getTargetFileSystem())
                 .getMyFs().getFileStatus(new Path(linkedPath));