s3:smbd/durable: trigger pending write_time updates before disconnecting the file
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Oct 2012 08:54:27 +0000 (10:54 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 19 Oct 2012 13:09:58 +0000 (15:09 +0200)
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 <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/durable.c

index 42ad18e5b6578d5b85002ccfe0c82434803866b5..feec0dad6e381ee93e071f51726aa50ac2e4d68f 100644 (file)
@@ -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