This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 496716 - GFS2 ">>" will not update ctime,mtime after appending to the file
GFS2 ">>" will not update ctime,mtime after appending to the file
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Abhijith Das
Red Hat Kernel QE team
:
Depends On:
Blocks: 533192 526775
  Show dependency treegraph
 
Reported: 2009-04-20 15:49 EDT by Shane Bradley
Modified: 2010-10-23 05:04 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 03:40:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to update times (2.05 KB, patch)
2009-05-06 10:54 EDT, Abhijith Das
no flags Details | Diff
second attempt patch (1.37 KB, patch)
2009-05-06 16:34 EDT, Abhijith Das
no flags Details | Diff
RHEL5 patch that also fixes mmap atime update (2.63 KB, patch)
2009-05-12 12:05 EDT, Abhijith Das
no flags Details | Diff
Upstream patch (does not contain the mmap atime update bit as it is already upstream) (1.47 KB, patch)
2009-05-12 12:06 EDT, Abhijith Das
no flags Details | Diff

  None (edit)
Description Shane Bradley 2009-04-20 15:49:37 EDT
Description of problem:

Appending to a file via redirection ">>" does not update the
atime,ctime, mtime on files that it redirected to. All other
methods seem to work correctly which includes: user space
apps(emacs), and ">" redirection.

Customer is using ">>" to append to files. When they append to
the file with ">>" the timestamps are not updated on local or
remote nodes which is a problem because they use timestamps to
see when file was last updated.

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

Recreated on xen virtual machine with shared disk file image.

kmod-gfs2 is not installed.

$ rpm -qa | grep kmod
kmod-gfs-xen-0.1.23-5.el5_2.4
kmod-gfs-xen-0.1.31-3.el5

$  uname -a
Linux rh5node1 2.6.18-128.1.6.el5xen #1 SMP Tue Mar 24 12:28:27 EDT 2009 
x86_64 x86_64 x86_64 GNU/Linux

How reproducible:

The reproduciable seems to create most of the time, however there
are times when it does recreate exactly.

Steps to Reproduce:
1. date; echo "Hello Create" > /mnt/gfstest/readme.txt; \
   sleep 60; stat /mnt/gfstest/readme.txt; echo ""; \
   echo "DATE: $(date)";
2.  date; echo "Hello Appending" >> /mnt/gfstest/readme.txt; \
   sleep 60; stat /mnt/gfstest/readme.txt; echo ""; \
   echo "DATE: $(date)";
  
Actual results:

The atime, ctime, mtime fields are not updated when you stat the
file.However, sometimes the local notes gets ctime, mtime stat
fields updated and the remote nodes do not and atime is not
updated on any node.

Expected results:
atime, ctime, mtime should all be updated.

Additional info:
GFS1 will update atime, ctime, mtime correctly. I have also tried
setting "demote_secs" to 10 and yielded same results. 

Tried mounting with relatime and the option would not apply,
based on article:
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Global_File_System_2/s1-manage-atimeconf.html#s2-manage-mountrelatime 

$ mount -t gfs2 /dev/sda1 /mnt/gfstest -o relatime
/sbin/mount.gfs2: error mounting /dev/sda1 on /mnt/gfstest: Invalid argument
Comment 1 Abhijith Das 2009-04-20 17:48:49 EDT
Is this a GFS1 bug only or GFS2 as well? (The summary seems to suggest a GFS2 complaint)
Comment 2 Steve Whitehouse 2009-04-21 04:30:13 EDT
Is the time on the nodes synchronised with (for example) NTP and has it managed to actually pull the nodes in to having the same time on each? If not, then you will see strange things happening with the timestamps.
Comment 3 Issue Tracker 2009-04-22 16:38:12 EDT
These machines do not use NTP and their time is within a few seconds of
each other. GFS1 seems to work correctly. GFS1 will update the flags
correctly on ">>" redirection of data to append to a file.

--sbradley


This event sent from IssueTracker by sbradley 
 issue 274685
Comment 4 Steve Whitehouse 2009-05-05 12:01:33 EDT
This doesn't relate to atime, so adjusting the summary line.
Comment 5 Abhijith Das 2009-05-06 10:54:24 EDT
Created attachment 342669 [details]
Patch to update times
Comment 6 Abhijith Das 2009-05-06 16:34:01 EDT
Created attachment 342716 [details]
second attempt patch
Comment 7 Steve Whitehouse 2009-05-07 05:06:23 EDT
+		gfs2_dinode_out(ip, (void*) di);

does not need a cast to void. It takes a void pointer anyway. Also we should check page_mkwrite at the same time to ensure that it updates the timestamps correctly if thats required. Again a comparison with ext3 would be sensible.
Comment 8 Abhijith Das 2009-05-12 12:05:18 EDT
Created attachment 343615 [details]
RHEL5 patch that also fixes mmap atime update
Comment 9 Abhijith Das 2009-05-12 12:06:02 EDT
Created attachment 343616 [details]
Upstream patch (does not contain the mmap atime update bit as it is already upstream)
Comment 10 Abhijith Das 2009-05-12 19:20:01 EDT
sbradley, could you try out the patch in comment #8 and tell me if it works ok?
Comment 14 Abhijith Das 2009-06-08 17:29:43 EDT
Posted patch in comment #8 to rhkernel-list for inclusion in RHEL 5.5.
Comment 15 RHEL Product and Program Management 2009-09-25 13:37:45 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 16 Don Zickus 2009-10-06 15:36:57 EDT
in kernel-2.6.18-168.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.
Comment 18 Chris Ward 2010-02-11 05:21:46 EST
~~ Attention Customers and Partners - RHEL 5.5 Beta is now available on RHN ~~

RHEL 5.5 Beta has been released! There should be a fix present in this 
release that addresses your request. Please test and report back results 
here, by March 3rd 2010 (2010-03-03) or sooner.

Upon successful verification of this request, post your results and update 
the Verified field in Bugzilla with the appropriate value.

If you encounter any issues while testing, please describe them and set 
this bug into NEED_INFO. If you encounter new defects or have additional 
patch(es) to request for inclusion, please clone this bug per each request
and escalate through your support representative.
Comment 22 errata-xmlrpc 2010-03-30 03:40:01 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0178.html

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