[Bugs] [Bug 1401122] New: atime becomes zero when truncating file via ganesha ( or gluster-NFS)

bugzilla at redhat.com bugzilla at redhat.com
Fri Dec 2 22:01:07 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1401122

            Bug ID: 1401122
           Summary: atime becomes zero when truncating file via ganesha
                    (or gluster-NFS)
           Product: GlusterFS
           Version: 3.7.16
         Component: posix
          Assignee: bugs at gluster.org
          Reporter: eivind at pacbell.net
                CC: bugs at gluster.org



Created attachment 1227487
  --> https://bugzilla.redhat.com/attachment.cgi?id=1227487&action=edit
possible solution to problem

Description of problem:
Ganesha and gluster-NFS can both issue an fop_setattr(GF_SET_ATTR_MTIME)
without also setting GF_SET_ATTR_ATIME.  This will cause posix_setattr() to
issue lutimes() with zero value for atime.
There are slightly different ways to cause the issue in gluster-NFS and
Ganesha, but end result is the same.


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


How reproducible: Every time


Steps to Reproduce (gluster-NFS):
1. cp /vmlinuz /nfs/
2. dd if=/vmlinuz of=/nfs/vmlinuz conv=nocreat
3. stat /nfs/vmlinuz

Steps to Reproduce (Ganesha):
1. cp /vmlinuz /ganesha/
2. truncate -s 1000 /ganesha/vmlinuz
3. stat /ganesha/vmlinuz

Actual results:
root at vsan125:~# stat /nfs/vmlinuz
  File: ‘/nfs/vmlinuz’
  Size:  6579344      Blocks: 12851       IO Block: 1048576 regular file
Device: 1ch/28d Inode: 13728026437677438595  Links: 1
Access: (0600/-rw-------)  Uid: (65534/  nobody)   Gid: (4294967294/ UNKNOWN)
Access: 1969-12-31 16:00:00.000000000 -0800
Modify: 2016-12-02 11:07:36.000000000 -0800
Change: 2016-12-02 11:07:36.000000000 -0800
 Birth: -


Expected results:
Access time should not be 0.

Additional info:
Strace of glusterfsd setting atime to zero (in posix_do_utimes):
16332 utimensat(AT_FDCWD,
"/brick/gv5/.glusterfs/ac/b6/acb67218-b076-464e-b6a4-d153d7391e76", {{0, 0},
{1480627988, 0}}, AT_SYMLINK_NOFOLLOW

I have attached a proposed solution.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list