Skip to content
Permalink
Browse files
8274750: java/io/File/GetXSpace.java failed: '/dev': 191488 != 190976
Reviewed-by: rriggs, naoto
  • Loading branch information
Brian Burkhalter committed Oct 29, 2021
1 parent 5facaa2 commit 13265f9901ab8334bbe1e7a571a9c5f386275dbf
Showing 1 changed file with 4 additions and 3 deletions.
@@ -51,6 +51,7 @@
import static java.lang.System.err;
import static java.lang.System.out;

@SuppressWarnings("removal")
public class GetXSpace {

private static SecurityManager [] sma = { null, new Allow(), new DenyFSA(),
@@ -213,8 +214,9 @@ private static void compare(Space s) {
out.format(fmt, "df", s.total(), 0, s.free());
out.format(fmt, "getX", ts, fs, us);

// if the file system can dynamically change size, this check will fail
if (ts != s.total()) {
// If the file system can dynamically change size, this check will fail.
// This can happen on macOS for the /dev files system.
if (ts != s.total() && (!Platform.isOSX() || !s.name().equals("/dev"))) {
long blockSize = 1;
long numBlocks = 0;
try {
@@ -231,7 +233,6 @@ private static void compare(Space s) {
throw new RuntimeException(e);
}


// On macOS, the number of 1024 byte blocks might be incorrectly
// calculated by 'df' using integer division by 2 of the number of
// 512 byte blocks, resulting in a size smaller than the actual

3 comments on commit 13265f9

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 13265f9 Oct 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 13265f9 Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 13265f9 Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-13265f99 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 13265f99 from the openjdk/jdk repository.

The commit being backported was authored by Brian Burkhalter on 29 Oct 2021 and was reviewed by Roger Riggs and Naoto Sato.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-13265f99:GoeLin-backport-13265f99
$ git checkout GoeLin-backport-13265f99
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-13265f99

Please sign in to comment.