Merge pull request #6291 from dhiltgen/no_sparse_fail
Don't hard fail on sparse setup error
This commit is contained in:
commit
b7f7d8cd15
3 changed files with 5 additions and 7 deletions
|
@ -216,9 +216,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
|
|||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
if err := setSparse(file); err != nil {
|
||||
return err
|
||||
}
|
||||
setSparse(file)
|
||||
|
||||
_ = file.Truncate(b.Total)
|
||||
|
||||
|
|
|
@ -4,6 +4,5 @@ package server
|
|||
|
||||
import "os"
|
||||
|
||||
func setSparse(file *os.File) error {
|
||||
return nil
|
||||
func setSparse(*os.File) {
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@ import (
|
|||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func setSparse(file *os.File) error {
|
||||
return windows.DeviceIoControl(
|
||||
func setSparse(file *os.File) {
|
||||
// exFat (and other FS types) don't support sparse files, so ignore errors
|
||||
windows.DeviceIoControl( //nolint:errcheck
|
||||
windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
|
||||
nil, 0,
|
||||
nil, 0,
|
||||
|
|
Loading…
Reference in a new issue