summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-03-15 08:30:21 +0100
committerKarolin Seeger <kseeger@samba.org>2020-04-07 08:12:37 +0000
commitd6d93329b4c2eff0c041bfd11a471c3512709594 (patch)
tree1615596267fdde735e8c66968d06d97290cc9bc2
parent6d3279d01d9e75514fe8b7f070b32ed5b8d9e7c5 (diff)
downloadsamba-d6d93329b4c2eff0c041bfd11a471c3512709594.tar.gz
smbd: let delayed update handler also update on-disk timestamps
Let delayed update handler also update on-disk timestamps by calling trigger_write_time_update_immediate(). trigger_write_time_update_immediate() sets fsp->update_write_time_on_close to false which prevents updating the write-time on close if there was ever only one write to the file. Besides resetting fsp->update_write_time_on_close and setting the on-disk timestamps trigger_write_time_update_immediate() takes the same steps as the removed code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14320 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Mar 19 03:05:40 UTC 2020 on sn-devel-184 (cherry picked from commit 81c1a14e3271aeed7ed4fe6311171b19ba963555)
-rw-r--r--selftest/knownfail.d/samba3.smb2.timestamps1
-rw-r--r--source3/smbd/fileio.c10
2 files changed, 1 insertions, 10 deletions
diff --git a/selftest/knownfail.d/samba3.smb2.timestamps b/selftest/knownfail.d/samba3.smb2.timestamps
deleted file mode 100644
index dd4aeb59e2e..00000000000
--- a/selftest/knownfail.d/samba3.smb2.timestamps
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.timestamps.delayed-1write\(.*\)$
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index aba7f878b17..31d5b7510b7 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -104,15 +104,7 @@ void fsp_flush_write_time_update(struct files_struct *fsp)
DEBUG(5, ("Update write time on %s\n", fsp_str_dbg(fsp)));
- /* change the write time in the open file db. */
- (void)set_write_time(fsp->file_id, timespec_current());
-
- /* And notify. */
- notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED,
- FILE_NOTIFY_CHANGE_LAST_WRITE, fsp->fsp_name->base_name);
-
- /* Remove the timed event handler. */
- TALLOC_FREE(fsp->update_write_time_event);
+ trigger_write_time_update_immediate(fsp);
}
static void update_write_time_handler(struct tevent_context *ctx,