cp -p fails to preserve time

Jeremy Allison jra at samba.org
Tue Jul 31 18:48:28 UTC 2018


On Tue, Jul 31, 2018 at 05:56:32PM +0000, Rungta, Vandana wrote:
> 
> Requests received from the client:
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 76
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 77   fsp1
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_GETINFO] mid = 78
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_WRITE] mid = 79
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 80   fsp2
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_SETINFO] mid = 81
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CLOSE] mid = 82    fsp2 closed
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 83   fsp3
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_SETINFO] mid = 84
>
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CLOSE] mid = 85    fsp3 closed
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 86   fsp4
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_SETINFO] mid = 87
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CLOSE] mid = 88    fsp4 closed
> 
>   smbd_smb2_request_dispatch: opcode[SMB2_OP_CLOSE] mid = 89    fsp1 closed
> 
>  
> 
> BTW:  If the share is mounted using vers=1.0 time is preserved.
> 
>  
> 
> Is this a known problem? Is there a workaround?
> 
>  
> 
> Potential solution options:
> 
>  1. Option in smb.conf  to set update write time on close = no (File systems
>     set their own mtime based on writes received)
>  2. Additional parameter to the vfs function ntimes_fn – to specify if the
>     write modification time was because of a client request or because of
>     update write time on close
>  3. Additional opens (fsp2, fsp3, etc) go look through all open handles on the
>     files and clear the update write time on close flag if there is a setinfo
>     request that updates the mtime.
> 
>  
> 
> I am happy to provide any additional debug info.

I'd like to see the wireshark trace of this against Samba,
and also a wireshark trace against a Windows server doing
the same thing.

Looking at the code the SMB2_OP_SETINFO should cause smbd
to do the correct thing here, but I need to know what is
being sent to be sure.

Thanks !

Jeremy.



More information about the samba-technical mailing list