s3:vfs_gpfs:Fix query of creation time from GPFS
authorChristof Schmitt <christof.schmitt@us.ibm.com>
Tue, 29 Nov 2011 20:23:29 +0000 (13:23 -0700)
committerChristian Ambach <ambi@samba.org>
Fri, 10 Feb 2012 17:10:43 +0000 (18:10 +0100)
Setting the creation time through SetFileTime on a GPFS file system and
querying it with GetFileTime shows a mismatch.

The vfs_gpfs module first retrieves the information from the operating
system and the flag st_ex_calculated_birthtime is set to false. When
vfs_gpfs retrieves the birthtime from GPFS the flag
st_ex_calculated_birthtime has to be set to true. Otherwise the birth
time will get overwritten by a call to update_stat_ex_mtime, reporting
the wrong time to a client system.

Signed-off-by: Christian Ambach <ambi@samba.org>
source3/modules/vfs_gpfs.c

index 8400c50d2e401a357ef9850bd00473685f4c7fc7..bf47ee52f21dda56539788caab608d2f36e13b64 100644 (file)
@@ -1131,6 +1131,7 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle,
        ret = get_gpfs_winattrs(discard_const_p(char, fname), &attrs);
        TALLOC_FREE(fname);
        if (ret == 0) {
+               smb_fname->st.st_ex_calculated_birthtime = false;
                smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
                smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
                smb_fname->st.vfs_private = attrs.winAttrs;
@@ -1162,6 +1163,7 @@ static int vfs_gpfs_fstat(struct vfs_handle_struct *handle,
 
        ret = smbd_fget_gpfs_winattrs(fsp->fh->fd, &attrs);
        if (ret == 0) {
+               sbuf->st_ex_calculated_birthtime = false;
                sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
                sbuf->st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
        }
@@ -1197,6 +1199,7 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
        ret = get_gpfs_winattrs(discard_const_p(char, path), &attrs);
        TALLOC_FREE(path);
        if (ret == 0) {
+               smb_fname->st.st_ex_calculated_birthtime = false;
                smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
                smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
                smb_fname->st.vfs_private = attrs.winAttrs;