RFR: 8376700: java/nio/file/DirectoryStream/SecureDS.java fails AtomicMoveNotSupportedException
Brian Burkhalter
bpb at openjdk.org
Thu Jan 29 19:20:03 UTC 2026
On Thu, 29 Jan 2026 13:11:10 GMT, SendaoYan <syan at openjdk.org> wrote:
> Hi all,
>
> Before this PR, if the jtreg work directory and the /tmp directory locate in different linux volume or disk partition, test will report fails "java.nio.file.AtomicMoveNotSupportedException: file -> file: Invalid cross-device link". The linux syscall `rename()` doesn't support rename file across different volume, so I think the AtomicMoveNotSupportedException is not a JVM bug.
>
> This PR try to catch the AtomicMoveNotSupportedException and throw a SkippedException rather report fails. And split this test as two tests, one test for the default temporary directory '/tmp', another test for current jtreg work directory, this will make sure at least one test run non-skipped.
test/jdk/java/nio/file/DirectoryStream/SecureDS.java line 319:
> 317: sds.move(file, null, file);
> 318: } catch (AtomicMoveNotSupportedException e) {
> 319: throw new SkippedException("java.nio.file.AtomicMoveNotSupportedException");
Should this instead re-throw the `AtomicMoveNotSupportedException` if `dir` is the `CWD`, i.e., the rename is within the same volume?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29487#discussion_r2743129026
More information about the nio-dev
mailing list