summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/fileio.c15
2 files changed, 8 insertions, 8 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index d450eb51fa..c8c4f8c3cc 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -456,6 +456,7 @@ typedef struct files_struct {
uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */
uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
+ bool update_write_time_triggered;
struct timed_event *update_write_time_event;
bool update_write_time_on_close;
struct timespec close_write_time;
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);
}