diff --git a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java index ffe3aef44594..e5695dff0c2f 100644 --- a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java +++ b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java @@ -765,6 +765,16 @@ public FileChecksum getFileChecksum(Path f, long length) throws IOException { return super.getFileChecksum(f, length); } + @Override + protected Path fixRelativePart(Path p) { + String pathPatternString = p.toUri().getPath(); + if (pathPatternString.isEmpty()) { + return new Path("/"); + } else { + return super.fixRelativePart(p); + } + } + @Override public FileStatus[] globStatus(Path pathPattern) throws IOException { incrementCounter(Statistic.INVOCATION_GLOB_STATUS);