pxar/create: fix endless loop for shrinking files
when a file shrunk during backup, we endlessly looped, reading/copying 0 bytes we already have code that handles shrunk files, but we forgot to break from the read loop Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9d79cec4d5
commit
91e3b38da4
|
@ -661,6 +661,8 @@ impl<'a, 'b> Archiver<'a, 'b> {
|
||||||
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;
|
||||||
|
} else if got == 0 {
|
||||||
|
break; // we reached eof
|
||||||
}
|
}
|
||||||
out.write_all(&self.file_copy_buffer[..got])?;
|
out.write_all(&self.file_copy_buffer[..got])?;
|
||||||
remaining -= got as u64;
|
remaining -= got as u64;
|
||||||
|
|
Loading…
Reference in New Issue