Skip to content

Commit ccc74bb

Browse files
Amos ShiMBaesken
Amos Shi
authored andcommitted
8208623: [TESTBUG] runtime/LoadClass/LongBCP.java fails in AUFS file system
Limit the maximal file name length to 242 for AUFS file system Reviewed-by: mbaesken Backport-of: 03d6ab3
1 parent 7d85ecf commit ccc74bb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/hotspot/jtreg/runtime/LoadClass/LongBCP.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
*/
3535

3636
import java.io.File;
37+
import java.nio.file.Files;
38+
import java.nio.file.FileStore;
3739
import java.nio.file.Path;
3840
import java.nio.file.Paths;
3941
import java.util.Arrays;
@@ -103,8 +105,15 @@ public static void main(String args[]) throws Exception {
103105
// We currently cannot handle relative path specified in the
104106
// -Xbootclasspath/a on windows.
105107
//
106-
// relative path length within the 256 limit
107-
char[] chars = new char[255];
108+
// relative path length within the file system limit
109+
int fn_max_length = 255;
110+
// In AUFS file system, the maximal file name length is 242
111+
FileStore store = Files.getFileStore(new File(".").toPath());
112+
String fs_type = store.type();
113+
if ("aufs".equals(fs_type)) {
114+
fn_max_length = 242;
115+
}
116+
char[] chars = new char[fn_max_length];
108117
Arrays.fill(chars, 'y');
109118
String subPath = new String(chars);
110119
destDir = Paths.get(".", subPath);

0 commit comments

Comments
 (0)