Compare commits

...

1 Commits
v1.2.0 ... 840

Author SHA1 Message Date
Pengfei Li
6bce98e2f7 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: dholmes, redestad
(cherry picked from commit d7dbec973c)
2020-04-12 08:33:52 +07:00

View File

@@ -34,6 +34,8 @@
*/
import java.io.File;
import java.nio.file.Files;
import java.nio.file.FileStore;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
@@ -101,8 +103,15 @@ public class LongBCP {
// relative path tests
//
// relative path length within the 256 limit
char[] chars = new char[255];
// relative path length within the file system limit
int fn_max_length = 255;
// In AUFS file system, the maximal file name length is 242
FileStore store = Files.getFileStore(new File(".").toPath());
String fs_type = store.type();
if ("aufs".equals(fs_type)) {
fn_max_length = 242;
}
char[] chars = new char[fn_max_length];
Arrays.fill(chars, 'y');
String subPath = new String(chars);
destDir = Paths.get(".", subPath);