Bug 19279 - cpio pass-through faulty if file grows during copy
Summary: cpio pass-through faulty if file grows during copy
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cpio   
(Show other bugs)
Version: 6.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: bero
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-17 18:03 UTC by jeff.parrott
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-29 18:35:07 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 18:34 UTC, jeff.parrott
no flags Details

Description jeff.parrott 2000-10-17 18:03:20 UTC
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 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

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