Repository navigation
Conversation
…Windows _wstat64/_fstat64 report st_ino 0 and disagree on st_dev (drive number vs 0), so a guest st_dev/st_ino identity check matched every pair of files from stat and never matched across stat and fstat. Read the volume serial number, file index and link count from the file's handle for disk files, the same way for path and descriptor stat. Fixes boykopovar#2296 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows validation for PR #2362:
This provides independent native-Windows build and test coverage for the No production code was modified during validation. |
Collaborator
|
Closing: no title is shown to depend on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #2296.
On Windows,
_wstat64/_fstat64reportst_ino0, andst_devis the drive number fromstatbut 0 fromfstat. So the guestst_dev/st_inoidentity check matched every pair of files fromstatand never matched acrossstatandfstat.NativeStat.cppnow takes the identity from the file's handle withGetFileInformationByHandle, the same way for path and descriptorstat:st_dev=dwVolumeSerialNumberst_ino= the 64-bit file index folded into the guest's 32-bitino_t(low ^ high)st_nlink=nNumberOfLinksPath
statopens the file withFILE_READ_ATTRIBUTESandFILE_FLAG_BACKUP_SEMANTICS(so directories work too) and full sharing. Descriptorstatuses_get_osfhandle. Directory descriptors go through their path. Descriptors that are not disk files (pipes, consoles) keep the previous values, sofstaton them still succeeds. Linux is unchanged.GuestFilesystem.cppchecks that two files in one directory sharest_devand differ inst_ino, and thatsceKernelStatandsceKernelFstatof the same file agree on both.Note: #1518 also edits
NativeStat.cpp(timestamps). The changes are independent. Whichever lands second needs a small rebase.Tested
Not tested: not built or run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt: N/A.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code