Bug 19279 - cpio pass-through faulty if file grows during copy
cpio pass-through faulty if file grows during copy
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: cpio (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: bero
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-17 14:03 EDT by jeff.parrott
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-29 14:35:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Includes my modifications to correct bug 19279-sorry for the delay. (194.06 KB, application/octet-stream)
2001-05-29 14:34 EDT, jeff.parrott
no flags Details

  None (edit)
Description jeff.parrott 2000-10-17 14:03:20 EDT
This has been reported by me to bug-gnu-utils@prep.ai.mit.edu and logged 
as a cpio maintenance request. I thought you might like to know.

I have seen corrupted files as a result of using the pass-through option 
in cpio. The corruption occurs when active/in-use (and growing) files are 
being copied. The problem is that the file size has grown since the time 
of the stat() call (made in process_copy_pass). This will give you more 
bytes than you expect in the last read and as a result on the next call to 
copy_files_disk_to_disk() you will have "input_size" not starting at zero 
and you will get the ending bytes from the last file copied into the 
current file. 

So the problem is two-fold 1) you do not get the complete file copied; and 
2) you get parts of one file copied to another!

For my purposes, I have rewritten copy_files_disk_to_disk() to ignore the 
num_bytes input parameter and to just copy until EOF. The problem might 
also appear in other parts of the cpio source. I have rewritten it to 
serve my purposes for the moment (to suit my needs given the heavy 
schedule pressure I am under). I think you should make a more thorough 
code inspection to insure all problems of this nature are fixed 
accordingly in the complete cpio source.
Comment 1 Jeff Johnson 2001-01-18 10:51:17 EST
Could you include a copy of your patch to cpio as an attachment? Thanks.
Comment 2 Bernhard Rosenkraenzer 2001-05-15 11:17:37 EDT
Closing due to inactivity
Comment 3 jeff.parrott 2001-05-29 14:34:33 EDT
Created attachment 19912 [details]
Includes my modifications to correct bug 19279-sorry for the delay.
Comment 4 Bernhard Rosenkraenzer 2001-07-04 06:37:45 EDT
Thanks, fixed in 2.4.2-23

Note You need to log in before you can comment on or make changes to this bug.