Bug 205583

Summary: [RHEL4 U4] MD5SUM's do not match after copy of symlinked directory
Product: Red Hat Enterprise Linux 4 Reporter: Joshua Giles <jgiles>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: meyering
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-07 16:33:31 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
RHEL4 script
none
RHEL3 script
none
The copied directories md5sum
none
The soft linked directories md5sum listing
none
Original source md5sum none

Description Joshua Giles 2006-09-07 13:51:05 UTC
Description of problem:

I've got scripts that I want to use for kernel compilation, however I am
seeing md5sum failures on RHEL4.  I've pulled the relevant parts of my
script(s) into two scripts which are attached.  The scripts get a
kernel.src.rpm from porkchop (wget) then install and build-prep followed
by a cp from the symlink (pointing to the prepared kernel) to a new
directory.  Finally the md5sum is calculated for the symlinked, copied
and original directories.  The symlinked file reports a different md5sum
than the other directories.

The failure occurs with 2.6 (U2, U3) but not on 2.4 (RHEL3) machines.  Also, if
I use sum instead of md5sum I don't see the errors.


Version-Release number of selected component (if applicable):
coreutils-5.2.1-31.4

How reproducible:
100%

Steps to Reproduce: 
1. Install RHEL 4 U4 and start script(s) above (requires rpmbuild and probably
kernel-utils.)
2.
3.
  
Actual results:
MD5SUMs do not match.

Expected results:


Additional info:

Erm, I may be doing something wrong but I would expect behavior to be 
consistent across OS'es.  Also, this is most likely not an md5sum problem but I
thought it would be a good place to start.

Comment 1 Joshua Giles 2006-09-07 13:52:37 UTC
Created attachment 135757 [details]
RHEL4 script

Comment 2 Joshua Giles 2006-09-07 13:53:26 UTC
Created attachment 135759 [details]
RHEL3 script

Comment 3 Tim Waugh 2006-09-07 14:08:54 UTC
Seeing as the md5sum input is just a directory listing, perhaps you could attach
the actual directory listings themselves rather than asking me to compile a
kernel to get them.. :-)

Comment 4 Joshua Giles 2006-09-07 14:56:34 UTC
Created attachment 135771 [details]
The copied directories md5sum

Comment 5 Joshua Giles 2006-09-07 14:57:24 UTC
Created attachment 135772 [details]
The soft linked directories md5sum listing

Comment 6 Joshua Giles 2006-09-07 14:58:07 UTC
Created attachment 135773 [details]
Original source md5sum

Comment 7 Joshua Giles 2006-09-07 14:59:30 UTC
 diff -burN copy.md5sum src-link.md5sum
--- copy.md5sum 2006-09-06 11:16:08.000000000 -0400
+++ src-link.md5sum     2006-09-06 11:16:09.000000000 -0400
@@ -13752,7 +13752,7 @@
 -rw-r--r--  1 root root 1794 Oct 18  2004 uuid.h

 include:
-total 300
+total 296
 drwxr-xr-x   3 root root  4096 Oct 18  2004 acpi
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 asm-alpha
 drwxr-xr-x  24 root root  4096 Oct 18  2004 asm-arm
@@ -13778,7 +13778,7 @@
 drwxr-xr-x   2 root root  4096 Oct 18  2004 asm-v850
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 asm-x86_64
 drwxr-xr-x   2 root root  4096 Sep  6 11:14 keys
-drwxr-xr-x  18 root root 24576 Sep  6 11:15 linux
+drwxr-xr-x  18 root root 20480 Sep  6 11:15 linux
 drwxr-xr-x   2 root root  4096 Oct 18  2004 math-emu
 drwxr-xr-x   2 root root  4096 Oct 18  2004 media
 drwxr-xr-x   2 root root  4096 Oct 18  2004 mtd


#########
It's always the linux directory that is different.

Comment 8 Tim Waugh 2006-09-07 16:33:31 UTC
So one or more files or directories are taking up different numbers of blocks. 
I expect there is a sparse file or some such thing, or else the directories from
the build directory are larger due to having had to accommodate the built object
files etc.

Please file a more specific test case if you think there really is a bug.

Comment 9 Joshua Giles 2006-09-07 17:58:35 UTC
I'm not sure I understand you.  How is one to tell if you have data corruption
or some other problem(s) if you see an md5sum failure?  Is md5sum useless in
certain cases?  Also, this is a different behavior from RHEL3; Por que?  

How do I help investigate the real reason for failure?

Comment 10 Tim Waugh 2006-09-08 08:32:01 UTC
You got different md5sums because you fed md5sum different inputs -- as
demonstrated by the diff in comment #7.  You are md5summing the output of 'ls
-lR' (for some reason!).