Bug 8144 - touch /mnt/newfile fails to set timestamp with CIFS client.
Summary: touch /mnt/newfile fails to set timestamp with CIFS client.
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.6.0rc1
Hardware: All All
: P5 regression
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 22:59 UTC by Jeremy Allison
Modified: 2011-05-18 17:38 UTC (History)
0 users

See Also:


Attachments
Patch for 3.6.0rc1 (2.90 KB, patch)
2011-05-17 23:35 UTC, Jeremy Allison
vl: review+
jlayton: review+
jra: review? (sfrench)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2011-05-17 22:59:59 UTC
With 3.6.0rc1 mount a cifsfs share as /mnt, then type:

touch /mnt/newfile

Although the file is created an error message is printed setting the file timestamps.

This is caused by the extra checks added for Windows correctness in our metadata changing paths to ensure the file handle has been opened with the correct access mask to allow FILE_WRITE_ATTRIBUTES etc.

The old POSIX open code maps O_RDONLY into FILE_READ, O_WRONLY into FILE_WRITE, and O_RDWR into FILE_READ|FILE_WRITE. This need to be extended to add FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES and FILE_WRITE_EA, FILE_READ_EA to allow POSIX opens to set these values.

Patch to follow.

Jeremy.
Comment 1 Jeremy Allison 2011-05-17 23:35:52 UTC
Created attachment 6451 [details]
Patch for 3.6.0rc1

Patch I'm committing to master.

Jeremy.
Comment 2 Jeremy Allison 2011-05-17 23:51:54 UTC
Comment on attachment 6451 [details]
Patch for 3.6.0rc1

Once one of you guys are content, re-assign to Karolin for inclusion in 3.6.0 final.
Comment 3 Jeremy Allison 2011-05-18 16:21:00 UTC
FYI. The reason this got by testing is that we don't have a cli_posix_ntimes() call which would have exercised the time set on an open file handle. I'll look into coding this up and adding it to the smbtorture suite.

Jeremy.
Comment 4 Jeremy Allison 2011-05-18 16:22:45 UTC
Karolin, please commit to v3-6-test. Thanks !
Jeremy.
Comment 5 Karolin Seeger 2011-05-18 17:38:47 UTC
Pushed to v3-6-test.
Closing out bug report.

Thanks!