From 8ce9982be9dac71bbfc109e7f0c43aec94850c89 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Tue, 29 Nov 2011 13:23:29 -0700 Subject: s3:vfs_gpfs:Fix query of creation time from GPFS 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 --- source3/modules/vfs_gpfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 8400c50d2e..bf47ee52f2 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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; -- cgit