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

[release/0.4] Backport fixes from v0.5.1 to 0.4 #222

merged 4 commits into from Oct 15, 2021


Copy link

@kevpar kevpar commented Oct 15, 2021

Backport of these PRs:

kevpar and others added 4 commits Oct 15, 2021
These packages had incorrect error handling for their generated syscall
bindings. The functions they were calling returned errors directly, but
the binding was written such that the generated code was calling
GetLastError instead.

Thankfully, this did not affect the detection of whether or not an error
had occurred, it only caused the value returned in the case of an error
to be not the right error code.

Signed-off-by: Kevin Parsons <>
(cherry picked from commit 9f0ab2c)
Signed-off-by: Kevin Parsons <>
(cherry picked from commit 0b148d1)
Signed-off-by: Kevin Parsons <>
A recent OS change altered how sparse files are represented in backup
streams. This caused backuptar to no longer work with certain files. The
specific behavior that changed is as follows:
- Empty sparse files (size = 0), previously did not have any data or
  sparse block streams in the backup stream. Now, they will have a
  data stream with size = 0, and no sparse block streams.
- Sparse files with a single allocated range (e.g. a normal file that
  has the sparse attribute set) previously would not show as sparse in
  the backup stream. Now, they will show as sparse.

The old backuptar behavior assumed that if the sparse flag was set on
the data stream, then there would always be a set of sparse blocks
following. These changes break this assumption, and so require special

It is unsupported to have a data stream, marked sparse, that contains
file content AND a series of sparse block streams following. As far as
I can tell this is not a valid case for backup streams.

This change also cleans up some code and error messages, and expands on
the test coverage for backuptar.

For more information on backup stream format see:

Signed-off-by: Kevin Parsons <>
(cherry picked from commit 33a4801)
Signed-off-by: Kevin Parsons <>
Signed-off-by: Kyle Wojtaszek <>
(cherry picked from commit 4c72048)
Signed-off-by: Kevin Parsons <>
@kevpar kevpar requested a review from as a code owner Oct 15, 2021
Copy link

@katiewasnothere katiewasnothere left a comment

LGTM on CI passing


@kevpar kevpar merged commit 7e149e8 into microsoft:release/0.4 Oct 15, 2021
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants