svn commit: samba r23589 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_25/source/smbd SAMBA_3_0_26/source/smbd

jra at samba.org jra at samba.org
Fri Jun 22 17:19:09 GMT 2007


Author: jra
Date: 2007-06-22 17:19:08 +0000 (Fri, 22 Jun 2007)
New Revision: 23589

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23589

Log:
Ensure we will always release any timeout handler
on fsp close or removal of oplock. Mulitple removals
are safe.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/files.c
   branches/SAMBA_3_0/source/smbd/oplock.c
   branches/SAMBA_3_0_25/source/smbd/files.c
   branches/SAMBA_3_0_25/source/smbd/oplock.c
   branches/SAMBA_3_0_26/source/smbd/files.c
   branches/SAMBA_3_0_26/source/smbd/oplock.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/files.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/files.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0/source/smbd/files.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -439,6 +439,9 @@
 		TALLOC_FREE(fsp->notify);
 	}
 
+	/* Ensure this event will never fire. */
+	TALLOC_FREE(fsp->oplock_timeout);
+
 	bitmap_clear(file_bmap, fsp->fnum - FILE_HANDLE_OFFSET);
 	files_used--;
 

Modified: branches/SAMBA_3_0/source/smbd/oplock.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/oplock.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0/source/smbd/oplock.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -152,6 +152,8 @@
 	fsp->sent_oplock_break = NO_BREAK_SENT;
 	
 	flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH);
+
+	TALLOC_FREE(fsp->oplock_timeout);
 }
 
 /****************************************************************************
@@ -341,12 +343,8 @@
 {
 	files_struct *fsp = (files_struct *)private_data;
 
-	/* Ensure we always remove this event. */
-	if (fsp->oplock_timeout != NULL) {
-		/* Remove the timed event handler. */
-		TALLOC_FREE(fsp->oplock_timeout);
-		fsp->oplock_timeout = NULL;
-	}
+	/* Remove the timed event handler. */
+	TALLOC_FREE(fsp->oplock_timeout);
 	DEBUG(0, ("Oplock break failed for file %s -- replying anyway\n", fsp->fsp_name));
 	global_client_failed_oplock_break = True;
 	remove_oplock(fsp);

Modified: branches/SAMBA_3_0_25/source/smbd/files.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/files.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0_25/source/smbd/files.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -444,6 +444,9 @@
 		TALLOC_FREE(fsp->notify);
 	}
 
+	/* Ensure this event will never fire. */
+	TALLOC_FREE(fsp->oplock_timeout);
+
 	bitmap_clear(file_bmap, fsp->fnum - FILE_HANDLE_OFFSET);
 	files_used--;
 

Modified: branches/SAMBA_3_0_25/source/smbd/oplock.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/oplock.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0_25/source/smbd/oplock.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -153,6 +153,8 @@
 	fsp->sent_oplock_break = NO_BREAK_SENT;
 	
 	flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH);
+
+	TALLOC_FREE(fsp->oplock_timeout);
 }
 
 /****************************************************************************
@@ -349,12 +351,8 @@
 {
 	files_struct *fsp = (files_struct *)private_data;
 
-	/* Ensure we always remove this event. */
-	if (fsp->oplock_timeout != NULL) {
-		/* Remove the timed event handler. */
-		TALLOC_FREE(fsp->oplock_timeout);
-		fsp->oplock_timeout = NULL;
-	}
+	/* Remove the timed event handler. */
+	TALLOC_FREE(fsp->oplock_timeout);
 	DEBUG(0, ("Oplock break failed for file %s -- replying anyway\n", fsp->fsp_name));
 	global_client_failed_oplock_break = True;
 	remove_oplock(fsp);

Modified: branches/SAMBA_3_0_26/source/smbd/files.c
===================================================================
--- branches/SAMBA_3_0_26/source/smbd/files.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0_26/source/smbd/files.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -439,6 +439,9 @@
 		TALLOC_FREE(fsp->notify);
 	}
 
+	/* Ensure this event will never fire. */
+	TALLOC_FREE(fsp->oplock_timeout);
+
 	bitmap_clear(file_bmap, fsp->fnum - FILE_HANDLE_OFFSET);
 	files_used--;
 

Modified: branches/SAMBA_3_0_26/source/smbd/oplock.c
===================================================================
--- branches/SAMBA_3_0_26/source/smbd/oplock.c	2007-06-22 14:54:39 UTC (rev 23588)
+++ branches/SAMBA_3_0_26/source/smbd/oplock.c	2007-06-22 17:19:08 UTC (rev 23589)
@@ -152,6 +152,8 @@
 	fsp->sent_oplock_break = NO_BREAK_SENT;
 	
 	flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH);
+
+	TALLOC_FREE(fsp->oplock_timeout);
 }
 
 /****************************************************************************
@@ -341,12 +343,8 @@
 {
 	files_struct *fsp = (files_struct *)private_data;
 
-	/* Ensure we always remove this event. */
-	if (fsp->oplock_timeout != NULL) {
-		/* Remove the timed event handler. */
-		TALLOC_FREE(fsp->oplock_timeout);
-		fsp->oplock_timeout = NULL;
-	}
+	/* Remove the timed event handler. */
+	TALLOC_FREE(fsp->oplock_timeout);
 	DEBUG(0, ("Oplock break failed for file %s -- replying anyway\n", fsp->fsp_name));
 	global_client_failed_oplock_break = True;
 	remove_oplock(fsp);



More information about the samba-cvs mailing list