The Samba-Bugzilla – Bug 4854
Close packet contains wrong last modified time
Last modified: 2009-03-07 11:02:50 UTC
I'm using the cifs kernel module v1.45 to mount a NetApp filer and I noticed that most of my files have their last modified time set to the epoch (Jan 1, 1970 00:00:00 GMT). I tracked this down to the cifs kernel module net setting the right value for the last modified time.
In cifssmb.c in the CIFSSMBClose function, you will find the line below:
pSMB->LastWriteTime = 0;
It should be
pSMB->LastWriteTime = -1;
The SNIA CIFS documentation is wrong on the meaning of value 0.
Created attachment 2849 [details]
Ethereal trace of a Windows client
Notice the value supplied by the XP client for the "Last Write" field on CLOSE request packets.
This is now fixed. The value of LasWriteTime is now -1.
Fixed - code has been doing
pSMB->LastWriteTime = 0xFFFFFFFF;
in SMBClose for quite a while now