Bug 1411277

Summary: truncate setting accesstime of a file (atime) to unix epoch beginning time(01-01-1970)
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Nag Pavan Chilakam <nchilaka>
Component: nfs-ganeshaAssignee: Kaleb KEITHLEY <kkeithle>
Status: CLOSED DUPLICATE QA Contact: surabhi <sbhaloth>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.2CC: jthottan, nchilaka, rhs-bugs, skoduri, storage-qa-internal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-10 13:24:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nag Pavan Chilakam 2017-01-09 10:27:28 UTC
Description of problem:
==========================
whenever I create a file using truncate, the file is always set with the access time /atime as epoch time starting

This can be an issue, for applications relying on atime explicitly.
There can be different apps like mail servers, archival tools relying on atime
and due to this we may end up serving wrong time

I am not able to see this on fuse mount
Version-Release number of selected component (if applicable):
=========================
[root@dhcp35-37 3.8.4-11]# rpm -qa|egrep "gluster|ganesha"
glusterfs-events-3.8.4-11.el7rhgs.x86_64
glusterfs-rdma-3.8.4-11.el7rhgs.x86_64
glusterfs-api-3.8.4-11.el7rhgs.x86_64
glusterfs-server-3.8.4-11.el7rhgs.x86_64
nfs-ganesha-gluster-2.4.1-3.el7rhgs.x86_64
nfs-ganesha-debuginfo-2.4.1-3.el7rhgs.x86_64
glusterfs-libs-3.8.4-11.el7rhgs.x86_64
glusterfs-cli-3.8.4-11.el7rhgs.x86_64
nfs-ganesha-2.4.1-3.el7rhgs.x86_64
glusterfs-3.8.4-11.el7rhgs.x86_64
glusterfs-fuse-3.8.4-11.el7rhgs.x86_64
glusterfs-debuginfo-3.8.4-11.el7rhgs.x86_64
glusterfs-client-xlators-3.8.4-11.el7rhgs.x86_64
python-gluster-3.8.4-11.el7rhgs.noarch
glusterfs-ganesha-3.8.4-11.el7rhgs.x86_64
glusterfs-geo-replication-3.8.4-11.el7rhgs.x86_64




How reproducible:
=======
always


Steps to Reproduce:
1.created a dist=ec volume on a 6 node cluster and 4 node ganesha
2.mounted the volume on two clients with different vips
3.now issue a truncate of file say "truncate file1 --size 4gb"

if u check the atime, it always shows it as below

[root@dhcp35-107 disperse-ganesha]# stat gyan
  File: `gyan'
  Size: 4000000000	Blocks: 0          IO Block: 1048576 regular file
Device: 1ch/28d	Inode: 11298515324991194880  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 1970-01-01 05:30:00.000000000 +0530
Modify: 2017-01-09 15:46:36.000000000 +0530
Change: 2017-01-09 15:46:36.000000000 +0530

Comment 2 Nag Pavan Chilakam 2017-01-09 10:49:02 UTC
i just Saw that Niels has reported a similar bug upstream https://bugzilla.redhat.com/show_bug.cgi?id=1411010 ==>atime becomes zero when truncating file via ganesha (or gluster-NFS) 
1401777 - atime becomes zero when truncating file via ganesha (or gluster-NFS)

Comment 3 Nag Pavan Chilakam 2017-01-09 11:07:29 UTC
i hit this bug while verifying https://bugzilla.redhat.com/show_bug.cgi?id=1409808  [Mdcache] clients being served wrong information about a file, can lead to file inconsistency

Comment 5 Kaleb KEITHLEY 2017-01-10 13:24:23 UTC

*** This bug has been marked as a duplicate of bug 1411014 ***

Comment 6 Nag Pavan Chilakam 2017-02-09 06:16:20 UTC
Agreeing to marking as duplicate.
removing the needinfo