svn commit: samba r17181 - in branches/SAMBA_3_0/source/locking: .

jra at samba.org jra at samba.org
Fri Jul 21 22:02:54 GMT 2006


Author: jra
Date: 2006-07-21 22:02:54 +0000 (Fri, 21 Jul 2006)
New Revision: 17181

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

Log:
Fix the build farm RAW-READ bug. When making a copy
of the lock array in order to delete them individually
it's also important to make a copy of the *size* of
this array. Otherwise the unlock decrements the termination
index of your for loop :-). Doh ! Big thanks to Volker
for showing me how to set up the build farm to track
this one down. This is not a 3.0.23a issue.
Jeremy.

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


Changeset:
Modified: branches/SAMBA_3_0/source/locking/brlock.c
===================================================================
--- branches/SAMBA_3_0/source/locking/brlock.c	2006-07-21 16:26:25 UTC (rev 17180)
+++ branches/SAMBA_3_0/source/locking/brlock.c	2006-07-21 22:02:54 UTC (rev 17181)
@@ -1243,14 +1243,16 @@
 
 		if (unlock_individually) {
 			struct lock_struct *locks_copy;
+			unsigned int num_locks_copy;
 
 			/* Copy the current lock array. */
 			locks_copy = TALLOC_MEMDUP(br_lck, locks, br_lck->num_locks * sizeof(struct lock_struct));
 			if (!locks_copy) {
 				smb_panic("brl_close_fnum: talloc fail.\n");
 			}
+			num_locks_copy = br_lck->num_locks;
 
-			for (i=0; i < br_lck->num_locks; i++) {
+			for (i=0; i < num_locks_copy; i++) {
 				struct lock_struct *lock = &locks_copy[i];
 
 				if (lock->context.tid == tid && procid_equal(&lock->context.pid, &pid) &&



More information about the samba-cvs mailing list