Skip to content

8387309: GetXSpace test fails on ReFS and removable Windows volumes#31682

Open
raneashay wants to merge 1 commit into
openjdk:masterfrom
raneashay:JDK-8387309-getxspace-refs-removable
Open

8387309: GetXSpace test fails on ReFS and removable Windows volumes#31682
raneashay wants to merge 1 commit into
openjdk:masterfrom
raneashay:JDK-8387309-getxspace-refs-removable

Conversation

@raneashay

@raneashay raneashay commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

On both ReFS and removable drives, the primary path in libGetXSpace.c,
(which calls GetDiskSpaceInformationW() API function) fails because
the API call fails. When that happens, the code throws an exception,
causing the test to fail.

The key change in this patch is to switch to the fallback path (of
calling GetDiskFreeSpaceExW() to estimate the disk space) when
GetDiskSpaceInformationW() fails, making the test pass on machines
that have such non-standard volumes. This has the ancillary benefit of
handling all kinds of removable drives, so this patch removes the
special case for handling CDROM drives (whose code shelled out to "df",
which doesn't exist outside of Cygwin and MSys/MinGW).

This patch also fixes the return types and their handling for both
GetDiskSpaceInformationW() and GetDiskFreeSpaceExW() to match the
Windows API documentation.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8387309: GetXSpace test fails on ReFS and removable Windows volumes (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31682/head:pull/31682
$ git checkout pull/31682

Update a local copy of the PR:
$ git checkout pull/31682
$ git pull https://git.openjdk.org/jdk.git pull/31682/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31682

View PR using the GUI difftool:
$ git pr show -t 31682

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31682.diff

Using Webrev

Link to Webrev Comment

On both ReFS and removable drives, the primary path in libGetXSpace.c,
(which calls `GetDiskSpaceInformationW()` API function) fails because
the API call fails.  When that happens, the code throws an exception,
causing the test to fail.

The key change in this patch is to switch to the fallback path (of
calling `GetDiskFreeSpaceExW()` to estimate the disk space) when
`GetDiskSpaceInformationW()` fails, making the test pass on machines
that have such non-standard volumes.  This has the ancillary benefit of
handling _all_ kinds of removable drives, so this patch removes the
special case for handling CDROM drives (whose code shelled out to "df",
which doesn't exist outside of Cygwin and MSys/MinGW).

This patch also fixes the return types and their handling for both
`GetDiskSpaceInformationW()` and `GetDiskFreeSpaceExW()` to match the
Windows API documentation.
@bridgekeeper

bridgekeeper Bot commented Jun 25, 2026

Copy link
Copy Markdown

👋 Welcome back arane! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 25, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the core-libs core-libs-dev@openjdk.org label Jun 25, 2026
@openjdk

openjdk Bot commented Jun 25, 2026

Copy link
Copy Markdown

@raneashay The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 25, 2026
@mlbridge

mlbridge Bot commented Jun 25, 2026

Copy link
Copy Markdown

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant