RFR: 8338884: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp fails on alinux3 [v17]

Brian Burkhalter bpb at openjdk.org
Tue Oct 8 18:39:03 UTC 2024


On Mon, 9 Sep 2024 12:42:23 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hi all,
>> On alinux3(alibaba cloud linux version 3) system, the `/tmp` disk partition is mounted as tmpfs filesystem type, this filesystem type doesn't support create time(birth time).
>> 
>> Before this PR, this test [check](https://github.com/openjdk/jdk/blob/master/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#L110) if there is `statx` system call present or not to determise the test environment support birth time or not. I think it's not enough when the tested filesystem type is `tmpfs`. When the tested filesystem type is `tmpfs`, then the tested file doesn't support birth time.
>> 
>> On RHEL 8 tmpfs doesn't seem to support birth time, but on F39 tmpfs does seem to support birth time. Looks like this might be related to the kernel version. It's difficult to enumerate all the combination of file system type and linux kernel version to determine the testd file support birth time or not. So in this PR, I get the result from `statx` linux syscall, to determine the testd file support birth time or not.
>> 
>> Test fix only, the change has been verified, risk is low.
>> 
>> Additional test:
>> 
>> - [x] Alinux3 glibc:2.32
>> 1.  /tmp/file supportsCreationTimeRead == false
>> 2. ./file supportsCreationTimeRead == true
>> - [x] CentOS7 docker container glibc:2.17
>> 1.  /tmp/file supportsCreationTimeRead == false
>> 2. ./file supportsCreationTimeRead == false
>
> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   initail struct stx var to zero

test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java line 125:

> 123:             FileTime current = creationTime(file);
> 124:             if (!current.equals(creationTime)) {
> 125:                 System.out.println("current = " + current);

I think it would be better to use `System.err` on these two lines, as was done at line 81.

test/jdk/java/nio/file/attribute/BasicFileAttributeView/libCreationTimeHelper.c line 105:

> 103:     ret = my_statx_func(AT_FDCWD, file, atflag, mask, &stx);
> 104: 
> 105:     #ifdef DEBUG

This `DEBUG` block could be removed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20687#discussion_r1792336418
PR Review Comment: https://git.openjdk.org/jdk/pull/20687#discussion_r1792337030


More information about the nio-dev mailing list