From 9e7bce53707732700928eaf2bb53a5f1cc5d7784 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 19 Oct 2012 10:54:27 +0200 Subject: s3:smbd/durable: trigger pending write_time updates before disconnecting the file We need to call the pending write time update handler immediately. Which means we don't wait exactly 2 seconds before updating the write time after the first write. metze Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/smbd/durable.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index 42ad18e5b6..feec0dad6e 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -173,6 +173,14 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp, return NT_STATUS_NOT_SUPPORTED; } + /* Ensure any pending write time updates are done. */ + if (fsp->update_write_time_event) { + update_write_time_handler(fsp->conn->sconn->ev_ctx, + fsp->update_write_time_event, + timeval_current(), + (void *)fsp); + } + /* * The above checks are done in mark_share_mode_disconnected() too * but we want to avoid getting the lock if possible -- cgit