Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 636241

Summary: Discrepancy between gettimeofday and time
Product: Red Hat Enterprise Linux 5 Reporter: Stefan Ring <stefanrin>
Component: kernelAssignee: Prarit Bhargava <prarit>
Status: CLOSED CANTFIX QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: peterm, stefanrin
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 636255 (view as bug list) Environment:
Last Closed: 2010-09-21 18:44:11 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
Test program none

Description Stefan Ring 2010-09-21 17:50:52 UTC
Created attachment 448761 [details]
Test program

Description of problem:

This problem is very similar to bug #550968, yet it's something different. The attached test program shows that gettimeofday() exposes second increments earlier than time(). There is a fix for this in the mainline kernel, but it was never integrated in the stable 2.6.21 series or the RHEL kernel. The patch should be integrated in the RedHat kernel.

I have several wrongly-named dump/backup files at a customer site because of this.

Fix in mainline (between 2.6.22-rc2 and 2.6.22-rc3): http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d0aff6e6f4e54f79f9c89d147d371bad384454e9


Version-Release number of selected component (if applicable):
2.6.18-194.el5

Comment 1 Prarit Bhargava 2010-09-21 18:44:11 UTC
From BZ 461184:

"jturner noted that performance testing on the new time() syscall
 resulted in a 2200% increase in the amount of time to call time().  This is
 unacceptable so I am reverting this small change which will leave time()
 and gettimeofday() unsynchronized in RHEL5."

P.