summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-07-01 17:39:10 -0700
committerJeremy Allison <jra@samba.org>2009-07-01 17:39:10 -0700
commit82b5fad8be2cf05c17d115fa86c1049a41fae75b (patch)
treee60d57015d1515920b2a3523664f8014f55d5b59
parentb971860e01a3e616b0dd21990c054c8f8356f513 (diff)
downloadsamba-82b5fad8be2cf05c17d115fa86c1049a41fae75b.tar.gz
samba-82b5fad8be2cf05c17d115fa86c1049a41fae75b.tar.bz2
samba-82b5fad8be2cf05c17d115fa86c1049a41fae75b.zip
Ensure we don't use delayed writes on POSIX opened files.
Don't remove pending writetime changes if no time changes are sent in UNIX_BASIC infolevel. Jeremy
-rw-r--r--source3/smbd/fileio.c10
-rw-r--r--source3/smbd/trans2.c5
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 843b3f9586..5cc3d4b88b 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -193,6 +193,11 @@ void trigger_write_time_update(struct files_struct *fsp)
{
int delay;
+ if (fsp->posix_open) {
+ /* Don't use delayed writes on POSIX files. */
+ return;
+ }
+
if (fsp->write_time_forced) {
/* No point - "sticky" write times
* in effect.
@@ -224,6 +229,11 @@ void trigger_write_time_update(struct files_struct *fsp)
void trigger_write_time_update_immediate(struct files_struct *fsp)
{
+ if (fsp->posix_open) {
+ /* Don't use delayed writes on POSIX files. */
+ return;
+ }
+
if (fsp->write_time_forced) {
/*
* No point - "sticky" write times
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 41081ca0dd..28b07527cc 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6249,6 +6249,11 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n",
}
/* Deal with any time changes. */
+ if (null_timespec(ft.mtime) && null_timespec(ft.atime)) {
+ /* No change, don't cancel anything. */
+ return status;
+ }
+
id = vfs_file_id_from_sbuf(conn, psbuf);
for(all_fsps = file_find_di_first(id); all_fsps;
all_fsps = file_find_di_next(all_fsps)) {