RFR: 8343342: java/io/File/GetXSpace.java fails on Windows with CD-ROM drive [v9]

Taizo Kurashige duke at openjdk.org
Mon Dec 23 13:13:18 UTC 2024


> To resolve java/io/File/GetXSpace.java failure, I fix libGetXSpace.c to use  Cygwin’s `df` to get the size for comparison if the test target drive is a CD-ROM drive.
> 
> As described in JDK-8343342, GetDiskSpaceInformationW can't get information about the size of the CD-ROM drive. 
> GetDiskFreeSpaceExW can also get information about the size of the CD-ROM drive. However, because GetDiskFreeSpaceExW is called by the File.get-X-Space methods, it seems more reasonable to compare the size got by other way than GetDiskFreeSpaceExW as a test. For this reason, I use Cygwin's `df`.
> In JDK-8298619, GetDiskSpaceInformationW was adopted instead of `df` because the size got by File.get-X-Space methods may not match the size got by `df` when per-user quotas are used. I don't think this problem applies to CD-ROM  drive, so I think we can use Cygwin's `df` for CD-ROM drive.
> 
> After fix, I ran a test on Windows Server 2019 where drive C is a normal local disk, drive D is an unmounted iso CD-ROM  drive, and drive F is an iso mounted CD-ROM drive and confirmed that it passes.
> 
> I think this fix may also resolves the similar failure reported at https://github.com/openjdk/jdk/pull/12397#issuecomment-1705164515.
> 
> Thanks

Taizo Kurashige has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:

 - Merge branch 'openjdk:master' into fix_GetXSpace_bug
 - Fix getCDDriveSpace()
 - Fix macro for unix
 - Merge branch 'openjdk:master' into fix_GetXSpace_bug
 - Add ifdef WINDOWS
 - Merge branch 'openjdk:master' into fix_GetXSpace_bug
 - Modify to execute df in Java instead of C
 - Merge branch 'openjdk:master' into fix_GetXSpace_bug
 - Merge branch 'openjdk:master' into fix_GetXSpace_bug
 - Add 2>&1 to prevent messages containing "No such file or directory" from being output to System.err on jtr
 - ... and 1 more: https://git.openjdk.org/jdk/compare/65fbc596...ae1450a6

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21799/files
  - new: https://git.openjdk.org/jdk/pull/21799/files/2d3a658c..ae1450a6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21799&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21799&range=07-08

  Stats: 14778 lines in 526 files changed: 10652 ins; 2289 del; 1837 mod
  Patch: https://git.openjdk.org/jdk/pull/21799.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21799/head:pull/21799

PR: https://git.openjdk.org/jdk/pull/21799


More information about the core-libs-dev mailing list