summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-09-08 15:12:24 +0200
committerStefan Metzmacher <metze@samba.org>2008-09-08 16:25:41 +0200
commitc9fb96146cdae56a2711e176f07620d33ea0e18c (patch)
treedb552aa60a0497b82d53c432b00b9b480201097a /source3/smbd
parentae02be5287513659fc8a44fea3942e8ea6fea88a (diff)
downloadsamba-c9fb96146cdae56a2711e176f07620d33ea0e18c.tar.gz
samba-c9fb96146cdae56a2711e176f07620d33ea0e18c.tar.bz2
samba-c9fb96146cdae56a2711e176f07620d33ea0e18c.zip
smbd: some write time fixes
- only the first non truncating write causes the write time update with 2 seconds delay. It's not enough to check for an existing update event as it will be NULL after the event was triggered. - SMBwrite truncates always update the write time unless the sticky write time is set. - SMBwrite truncates don't trigger a write time update on close. metze (This used to be commit 3d17089b6dc773303c8c553f3f6140e60e348fb7)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/fileio.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 63850f24eb..095841825a 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -202,12 +202,13 @@ void trigger_write_time_update(struct files_struct *fsp)
return;
}
- if (fsp->update_write_time_event) {
+ if (fsp->update_write_time_triggered) {
/*
* No point - an event is already scheduled.
*/
return;
}
+ fsp->update_write_time_triggered = true;
delay = lp_parm_int(SNUM(fsp->conn),
"smbd", "writetimeupdatedelay",
@@ -232,14 +233,12 @@ void trigger_write_time_update_immediate(struct files_struct *fsp)
return;
}
- if (fsp->update_write_time_event) {
- /*
- * No point - an event is already scheduled.
- */
- return;
- }
+ TALLOC_FREE(fsp->update_write_time_event);
+ DEBUG(5, ("Update write time immediate on %s\n", fsp->fsp_name));
+
+ fsp->update_write_time_triggered = true;
- fsp->update_write_time_on_close = true;
+ fsp->update_write_time_on_close = false;
update_write_time(fsp);
}