1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-08 13:49:29 +03:00

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 <ambi@samba.org>
This commit is contained in:
Christof Schmitt
2011-11-29 13:23:29 -07:00
committed by Christian Ambach
parent 318346a937
commit 8ce9982be9

View 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;