pxar/create: handle ErrorKind::Interrupted for file reads
they are not an error and we should retry the read Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
91e3b38da4
commit
3c2dd8ad05
|
@ -657,7 +657,11 @@ impl<'a, 'b> Archiver<'a, 'b> {
|
||||||
let mut remaining = file_size;
|
let mut remaining = file_size;
|
||||||
let mut out = encoder.create_file(metadata, file_name, file_size)?;
|
let mut out = encoder.create_file(metadata, file_name, file_size)?;
|
||||||
while remaining != 0 {
|
while remaining != 0 {
|
||||||
let mut got = file.read(&mut self.file_copy_buffer[..])?;
|
let mut got = match file.read(&mut self.file_copy_buffer[..]) {
|
||||||
|
Ok(got) => got,
|
||||||
|
Err(err) if err.kind() == std::io::ErrorKind::Interrupted => continue,
|
||||||
|
Err(err) => bail!(err),
|
||||||
|
};
|
||||||
if got as u64 > remaining {
|
if got as u64 > remaining {
|
||||||
self.report_file_grew_while_reading()?;
|
self.report_file_grew_while_reading()?;
|
||||||
got = remaining as usize;
|
got = remaining as usize;
|
||||||
|
|
Loading…
Reference in New Issue