浏览代码

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

Ayush Saxena 4 年之前
父节点
当前提交
a8610c15c4

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

@@ -1202,6 +1202,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));