svn commit: samba r23516 - in branches: SAMBA_3_0/source/locking SAMBA_3_0_25/source/locking SAMBA_3_0_26/source/locking

jra at samba.org jra at samba.org
Sat Jun 16 01:04:24 GMT 2007


Author: jra
Date: 2007-06-16 01:04:22 +0000 (Sat, 16 Jun 2007)
New Revision: 23516

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

Log:
Fix bug found & fixed by Doug Rudoff (doug_rudoff at isilon.com)
- when cleaning up invalid locks make sure we mark the lck
struct as modified so it'll get saved back correctly (that
was the original intent).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/locking/brlock.c
   branches/SAMBA_3_0_25/source/locking/brlock.c
   branches/SAMBA_3_0_26/source/locking/brlock.c


Changeset:
Modified: branches/SAMBA_3_0/source/locking/brlock.c
===================================================================
--- branches/SAMBA_3_0/source/locking/brlock.c	2007-06-16 00:54:58 UTC (rev 23515)
+++ branches/SAMBA_3_0/source/locking/brlock.c	2007-06-16 01:04:22 UTC (rev 23516)
@@ -1646,6 +1646,7 @@
 	memcpy(br_lck->lock_data, data.dptr, data.dsize);
 	
 	if (!fsp->lockdb_clean) {
+		int orig_num_locks = br_lck->num_locks;
 
 		/* This is the first time we've accessed this. */
 		/* Go through and ensure all entries exist - remove any that don't. */
@@ -1658,6 +1659,11 @@
 			return NULL;
 		}
 
+		/* Ensure invalid locks are cleaned up in the destructor. */
+		if (orig_num_locks != br_lck->num_locks) {
+			br_lck->modified = True;
+		}
+
 		/* Mark the lockdb as "clean" as seen from this open file. */
 		fsp->lockdb_clean = True;
 	}

Modified: branches/SAMBA_3_0_25/source/locking/brlock.c
===================================================================
--- branches/SAMBA_3_0_25/source/locking/brlock.c	2007-06-16 00:54:58 UTC (rev 23515)
+++ branches/SAMBA_3_0_25/source/locking/brlock.c	2007-06-16 01:04:22 UTC (rev 23516)
@@ -1609,6 +1609,7 @@
 	br_lck->num_locks = data.dsize / sizeof(struct lock_struct);
 
 	if (!fsp->lockdb_clean) {
+		int orig_num_locks = br_lck->num_locks;
 
 		/* This is the first time we've accessed this. */
 		/* Go through and ensure all entries exist - remove any that don't. */
@@ -1623,6 +1624,11 @@
 			return NULL;
 		}
 
+                /* Ensure invalid locks are cleaned up in the destructor. */
+		if (orig_num_locks != br_lck->num_locks) {
+			br_lck->modified = True;
+		}
+
 		/*
 		 * validate_lock_entries might have changed locks. We can't
 		 * use a direct pointer here because otherwise gcc warnes

Modified: branches/SAMBA_3_0_26/source/locking/brlock.c
===================================================================
--- branches/SAMBA_3_0_26/source/locking/brlock.c	2007-06-16 00:54:58 UTC (rev 23515)
+++ branches/SAMBA_3_0_26/source/locking/brlock.c	2007-06-16 01:04:22 UTC (rev 23516)
@@ -1646,6 +1646,7 @@
 	memcpy(br_lck->lock_data, data.dptr, data.dsize);
 	
 	if (!fsp->lockdb_clean) {
+		int orig_num_locks = br_lck->num_locks;
 
 		/* This is the first time we've accessed this. */
 		/* Go through and ensure all entries exist - remove any that don't. */
@@ -1658,6 +1659,11 @@
 			return NULL;
 		}
 
+		/* Ensure invalid locks are cleaned up in the destructor. */
+		if (orig_num_locks != br_lck->num_locks) {
+			br_lck->modified = True;
+		}
+
 		/* Mark the lockdb as "clean" as seen from this open file. */
 		fsp->lockdb_clean = True;
 	}



More information about the samba-cvs mailing list