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

backuptar: Fix sparse file handling #221

Merged
merged 1 commit into from Oct 4, 2021
Merged

Commits on Sep 23, 2021

  1. backuptar: Fix sparse file handling

    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
    handling.
    
    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: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-bkup/f67950c8-d583-469a-83dd-c4ff4cedf533
    
    Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
    kevpar committed Sep 23, 2021
    Copy the full SHA
    33a4801 View commit details
    Browse the repository at this point in the history