Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 19279

Summary: cpio pass-through faulty if file grows during copy
Product: [Retired] Red Hat Linux Reporter: jeff.parrott
Component: cpioAssignee: bero
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-29 18:35:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Includes my modifications to correct bug 19279-sorry for the delay. none

Description jeff.parrott 2000-10-17 18:03:20 UTC
This has been reported by me to bug-gnu-utils.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 15:51:17 UTC
Could you include a copy of your patch to cpio as an attachment? Thanks.

Comment 2 Bernhard Rosenkraenzer 2001-05-15 15:17:37 UTC
Closing due to inactivity


Comment 3 jeff.parrott 2001-05-29 18:34:33 UTC
Created attachment 19912 [details]
Includes my modifications to correct bug 19279-sorry for the delay.

Comment 4 Bernhard Rosenkraenzer 2001-07-04 10:37:45 UTC
Thanks, fixed in 2.4.2-23