[Pkg-samba-maint] r1806 - in trunk/tdb/debian: . patches

ctrlsoft-guest at alioth.debian.org ctrlsoft-guest at alioth.debian.org
Tue Mar 25 21:39:11 UTC 2008


tags 425716 pending
thanks

Author: ctrlsoft-guest
Date: 2008-03-25 21:39:11 +0000 (Tue, 25 Mar 2008)
New Revision: 1806

Modified:
   trunk/tdb/debian/changelog
   trunk/tdb/debian/patches/20_clear_spinlocks.diff
Log:
Fix bug in the clear spinlocks patch, update changelog entry.


Modified: trunk/tdb/debian/changelog
===================================================================
--- trunk/tdb/debian/changelog	2008-03-25 20:44:12 UTC (rev 1805)
+++ trunk/tdb/debian/changelog	2008-03-25 21:39:11 UTC (rev 1806)
@@ -1,6 +1,7 @@
 tdb (1.1.1~svn26294-2) unstable; urgency=low
 
-  * Add patch to clear spinlocks if set (and not in use). (Closes: #425716)
+  * Add patch to clear spinlocks if set and opening a TDB in write mode. 
+    (Closes: #425716)
   * Change tdb-dev section to libdevel.
 
  -- Jelmer Vernooij <jelmer at samba.org>  Tue, 25 Mar 2008 21:43:50 +0100

Modified: trunk/tdb/debian/patches/20_clear_spinlocks.diff
===================================================================
--- trunk/tdb/debian/patches/20_clear_spinlocks.diff	2008-03-25 20:44:12 UTC (rev 1805)
+++ trunk/tdb/debian/patches/20_clear_spinlocks.diff	2008-03-25 21:39:11 UTC (rev 1806)
@@ -1,8 +1,7 @@
-Index: common/open.c
-===================================================================
---- common/open.c	(revision 24272)
-+++ common/open.c	(working copy)
-@@ -141,7 +141,21 @@
+diff -ur tdb-1.1.1~svn26294/common/open.c tdb-1.1.1~svn26294-fixed/common/open.c
+--- tdb-1.1.1~svn26294/common/open.c	2007-08-11 23:19:24.000000000 +0200
++++ tdb-1.1.1~svn26294-fixed/common/open.c	2008-03-25 22:35:24.000000000 +0100
+@@ -141,6 +141,20 @@
  {
  }
  
@@ -11,7 +10,7 @@
 +{
 +	off_t off = (off_t)((char *)&tdb->header.rwlocks
 +							- (char *)&tdb->header);
- 
++
 +	tdb->header.rwlocks = 0;
 +	if (lseek(tdb->fd, off, SEEK_SET) != off
 +		|| write(tdb->fd, (void *)&tdb->header.rwlocks,
@@ -20,15 +19,14 @@
 +		return -1;
 +	return 0;
 +}
-+
+ 
  struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
  				int open_flags, mode_t mode,
- 				const struct tdb_logging_context *log_ctx,
 @@ -222,9 +236,12 @@
  		goto fail;	/* errno set by tdb_brlock */
  	}
  
-+	if ((tdb_flags & TDB_CLEAR_IF_FIRST) || tdb->header.rwlocks != 0) {
++	if ((tdb_flags & TDB_CLEAR_IF_FIRST)) {
 +		locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0);
 +	}
 +
@@ -51,9 +49,14 @@
  	/* Is it already in the open list?  If so, fail. */
  	if (tdb_already_open(st.st_dev, st.st_ino)) {
  		TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: "
-@@ -286,13 +298,21 @@
+@@ -285,14 +297,26 @@
+ 	tdb->inode = st.st_ino;
  	tdb->max_dead_records = 0;
  	tdb_mmap(tdb);
++	if (!locked && tdb->header.rwlocks != 0) {
++		locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0);
++	}
++
  	if (locked) {
 +		/* Clear up spinlocks if there were any remaining */
 +		if (tdb->header.rwlocks != 0 && !tdb->read_only)




More information about the Pkg-samba-maint mailing list