Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-375900: Prepend \\?\ to file paths when creating streams for archive generation #3184

Merged

Conversation

danilo-delbusso
Copy link
Member

You'll need a host/pool with GFS2 storage to replicate this, as it creates large paths in %temp% when generating the Server Status Report.

The string works to enable creation of files with paths larger than 260 characters. This solution avoids us having to update registry keys which is an unwanted side effect.

7zip does this already so bypassing Windows restrictions has precedents. Plus this restriction isn't even relevant for our uses. We only really use it to build the archive.

Resources:

…hive generation

The string works to enable creation of files with paths larger than 260 characters.

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
XenCenterLib/StringUtility.cs Outdated Show resolved Hide resolved
@kc284 kc284 added the needs updating A reviewer has requested changes label Aug 1, 2023
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
`Directory.GetFiles` and `Directory.GetDirectories` do not enumerate if paths are longer than 260, even when prepended with `//?/`.

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
@danilo-delbusso danilo-delbusso added updated Changes completed, please review and removed needs updating A reviewer has requested changes labels Aug 7, 2023
@danilo-delbusso danilo-delbusso changed the title CA-375900: Prepend //?/ to file paths when creating streams for archive generation CA-375900: Prepend \\?\ to file paths when creating streams for archive generation Aug 7, 2023
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
@danilo-delbusso danilo-delbusso added ITE PR should be reviewed within this iteration ASAP PR should be reviewed as soon as possible and removed ITE PR should be reviewed within this iteration labels Aug 10, 2023
@CitrixChris CitrixChris added ITE PR should be reviewed within this iteration and removed ASAP PR should be reviewed as soon as possible labels Aug 16, 2023
XenCenterLib/Archive/ArchiveIterator.cs Outdated Show resolved Hide resolved
XenCenterLib/Archive/ArchiveWriter.cs Outdated Show resolved Hide resolved
XenCenterLib/Archive/ArchiveWriter.cs Outdated Show resolved Hide resolved
XenAdminTests/ArchiveTests/ArchiveWriterTests.cs Outdated Show resolved Hide resolved
XenAdminTests/ArchiveTests/ArchiveIteratorTests.cs Outdated Show resolved Hide resolved
XenCenterLib/Archive/ArchiveWriter.cs Outdated Show resolved Hide resolved
@kc284 kc284 added needs updating A reviewer has requested changes ITE PR should be reviewed within this iteration and removed ITE PR should be reviewed within this iteration updated Changes completed, please review labels Sep 5, 2023
…chiveIterator`

Also improves progress reporting by basing it on directory count

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
…d path lengths

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
…e using long path format

If files in the directory exceed the 260 character limit, the calls will fail

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
…and path lengths

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
@danilo-delbusso danilo-delbusso added updated Changes completed, please review and removed needs updating A reviewer has requested changes labels Sep 6, 2023
@CitrixChris CitrixChris added ASAP PR should be reviewed as soon as possible and removed ITE PR should be reviewed within this iteration labels Sep 11, 2023
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
The import uses `DiscUtils` which cannot handle paths prepended with `//?/`

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
XenCenterLib/Archive/ArchiveIterator.cs Outdated Show resolved Hide resolved
@CitrixChris CitrixChris added the 1 approval PR has been approved by one reviewer label Sep 18, 2023
This partially reverts commit 819425855c56c14b937849714b359003465bd2f4.

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
CitrixChris
CitrixChris previously approved these changes Sep 20, 2023
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
@danilo-delbusso danilo-delbusso removed the 1 approval PR has been approved by one reviewer label Sep 22, 2023
@CitrixChris CitrixChris added the 1 approval PR has been approved by one reviewer label Sep 22, 2023
@kc284 kc284 merged commit 86fa2f6 into xenserver:master Sep 22, 2023
1 check passed
@kc284 kc284 added 2 approvals PR has been approved by two reviewers and removed 1 approval PR has been approved by one reviewer updated Changes completed, please review labels Sep 22, 2023
@danilo-delbusso danilo-delbusso deleted the bug/gfs2-status-report-CA-375900 branch September 22, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 approvals PR has been approved by two reviewers ASAP PR should be reviewed as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants