RFR: 8338884: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp fails on alinux3 [v7]
SendaoYan
syan at openjdk.org
Thu Sep 5 08:44:29 UTC 2024
> 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 glibc:2.17
> 1. /tmp/file supportsCreationTimeRead == false
> 2. ./file supportsCreationTimeRead == false
SendaoYan has updated the pull request incrementally with four additional commits since the last revision:
- split too long lines to short lines
- use "Foreign Function & Memory API" instead of JNI
- fix compile error: libCreationTimeHelper.c:24:10: fatal error: 'linux/fcntl.h' file not found on windows and macos
- upload JNI solution temporary
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/20687/files
- new: https://git.openjdk.org/jdk/pull/20687/files/78fbf834..2ed8cb68
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=20687&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=20687&range=05-06
Stats: 138 lines in 3 files changed: 118 ins; 2 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/20687.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20687/head:pull/20687
PR: https://git.openjdk.org/jdk/pull/20687
More information about the nio-dev
mailing list