From b720d7770d93e67afe05beb3943913da241696d2 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Mon, 8 Jun 2020 01:59:10 +0530 Subject: [PATCH] HDFS-15396. Fix TestViewFileSystemOverloadSchemeHdfsFileSystemContract#testListStatusRootDir. Contributed by Ayush Saxena. (cherry picked from commit a8610c15c498531bf3c011f1b0ace8eddddf61f2) --- .../main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java index a19366e45c5..7552c06d1a2 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java +++ b/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 link = (INodeLink) inode; try { String linkedPath = link.getTargetFileSystem().getUri().getPath(); + if("".equals(linkedPath)) { + linkedPath = "/"; + } FileStatus status = ((ChRootedFileSystem)link.getTargetFileSystem()) .getMyFs().getFileStatus(new Path(linkedPath));