Bug 4854 - Close packet contains wrong last modified time
Close packet contains wrong last modified time
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
x86 Linux
: P3 major
: ---
Assigned To: Steve French
Depends on:
  Show dependency treegraph
Reported: 2007-08-02 15:47 UTC by Yanik Grignon
Modified: 2009-03-07 11:02 UTC (History)
1 user (show)

See Also:

Ethereal trace of a Windows client (39.99 KB, application/octet-stream)
2007-08-02 15:53 UTC, Yanik Grignon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yanik Grignon 2007-08-02 15:47:30 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.
Comment 1 Yanik Grignon 2007-08-02 15:53:43 UTC
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.
Comment 2 shirishpargaonkar@gmail.com 2009-01-20 14:52:03 UTC
This is now fixed.  The value of LasWriteTime is now -1.
Comment 3 Steve French 2009-01-20 16:28:43 UTC
Fixed - code has been doing

pSMB->LastWriteTime = 0xFFFFFFFF;

in SMBClose for quite a while now