[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3950-gbe8ac33

Jeremy Allison jra at samba.org
Mon Sep 8 16:57:31 GMT 2008


The branch, v3-3-test has been updated
       via  be8ac33179f56296118435e2732ccffdf7ddd305 (commit)
      from  77b3ca1a4be4ae780186ab4d46ec114b8dea41a8 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit be8ac33179f56296118435e2732ccffdf7ddd305
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 8 15:12:24 2008 +0200

    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

-----------------------------------------------------------------------

Summary of changes:
 source/include/smb.h |    1 +
 source/smbd/fileio.c |   15 +++++++--------
 2 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/smb.h b/source/include/smb.h
index d450eb5..c8c4f8c 100644
--- a/source/include/smb.h
+++ b/source/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/source/smbd/fileio.c b/source/smbd/fileio.c
index 63850f2..0958418 100644
--- a/source/smbd/fileio.c
+++ b/source/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);
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list