[DRBD-cvs] svn commit by phil - r2040 - in trunk: . debian documentation drbd scripts user - Svnp run...

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Dec 27 19:24:41 CET 2005


Author: phil
Date: 2005-12-27 19:24:36 +0100 (Tue, 27 Dec 2005)
New Revision: 2040

Added:
   trunk/documentation/drbddisk.sgml
Modified:
   trunk/
   trunk/ChangeLog
   trunk/Makefile
   trunk/debian/changelog
   trunk/debian/control
   trunk/debian/drbd0.7-utils.prerm
   trunk/debian/rules
   trunk/documentation/Makefile
   trunk/documentation/drbd.conf.sgml
   trunk/documentation/drbd.sgml
   trunk/documentation/drbdadm.sgml
   trunk/documentation/drbdsetup.sgml
   trunk/drbd.spec.in
   trunk/drbd/Makefile
   trunk/drbd/drbd_actlog.c
   trunk/drbd/drbd_bitmap.c
   trunk/drbd/drbd_fs.c
   trunk/drbd/drbd_int.h
   trunk/drbd/drbd_main.c
   trunk/drbd/drbd_proc.c
   trunk/drbd/drbd_receiver.c
   trunk/drbd/lru_cache.c
   trunk/drbd/lru_cache.h
   trunk/scripts/drbd.conf
   trunk/user/drbdadm_main.c
Log:
Svnp run...



Property changes on: trunk
___________________________________________________________________
Name: propagate:at
   - 1899
   + 1946

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/ChangeLog	2005-12-27 18:24:36 UTC (rev 2040)
@@ -14,6 +14,44 @@
 0.7 branch
 ----------
 
+0.7.13 (api:77/proto:74)
+-----
+ * Fixed a SMP race condition that caused the resync process to stall
+   after a few seconds to minutes.
+ * The sync speed display is replaced by the word "stalled" in case the 
+   syncer makes no progress within 20 seconds.
+ * Some improvements to the documentation.
+
+0.7.12 (api:77/proto:74)
+-----
+ * The /proc/drbd code used a fixed single page buffer. This breaks 
+   at about 30 configured devices. Changed that to use the seq_file
+   interface.
+ * Bind the source of TCP connections to the IP address that is
+   mentioned in the configuration. 
+ * Fixed a connection flip-flop bug when the two peers used different
+   user provided sizes.
+ * Various fixes in the online-resize code path, including online shrinking
+   and handling the case that the memory allocation for the new bitmap
+   failed.
+ * Random improvements to drbdadm: 
+   * The "size" option is now allowed in the disk section
+   * A new "disable-ip-verification" option for the global section
+   * The "disable-io-hints" option is not longer available.
+   * Allow "drbdadm -- --size=XXX resize r0".
+ * Fixed a potential very unlikely race condition that in the end would
+   trigger an ERR in drbd_actlog.c:607. Actually I never saw this trigger.
+ * Fixed a logic bug in _drbd_process_ee() that, paired with a race condition
+   could trigger a "ASSERT(b->n_req == set_size)" upon disconnect.
+ * Removed the "disable_io_hints" module parameter.
+ * Added the "disable_bd_claim" module parameter, to allow users, WHO 
+   KNOW WHAT THEY DO, to read-access the data on the secondary node.
+ * Allow "drbdadm invalidate" only in StandAlone and Connected states. 
+ * DRBD no longer goes into StandAlone mode, if there is an random network 
+   error during the handshake phase, instead it retries the to connect.
+   Only critical problems, e.g. incompatible protocols will cause it 
+   to go into StandAlone mode.
+
 0.7.11 (api:77/proto:74)
 -----
  * The upper limit of the runtime tuning parameter max_buffers 

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/Makefile	2005-12-27 18:24:36 UTC (rev 2040)
@@ -149,6 +149,7 @@
 	fi
 
 prepare_release:
+	svn up
 	$(MAKE) tarball
 	$(MAKE) tarball PRESERVE_DEBIAN=1
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/debian/changelog	2005-12-27 18:24:36 UTC (rev 2040)
@@ -1,23 +1,69 @@
-drbd (0.7.11-0) unstable; urgency=low
+drbd (0.7.13-0) unstable; urgency=low
 
-  * (Philipp Reisner)
-     - New upstream release
+  * New upstream release
 
- -- Philipp Reisner <phil at linbit.com>  Mon, 23 May 2005 15:29:21 +0200
+ -- Philipp Reisner <phil at linbit.com>  Thu, 1 Sep 2005 10:00:00 +0200
 
-drbd (0.7.10-0) unstable; urgency=low
+drbd (0.7.12-0) unstable; urgency=low
 
-  * (Philipp Reisner)
+  * New upstream release
+
+ -- Philipp Reisner <phil at linbit.com>  Wed, 24 Aug 2005 15:01:10 +0200
+
+drbd (0.7.11-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Cyril Bouthors <cyril at bouthors.org>  Mon, 20 Jun 2005 15:49:40 +0300
+
+drbd (0.7.10-4) unstable; urgency=low
+
+  * debian/control: added missing dependency to dpatch for
+    drbd0.7-module-source (closes: #308295).
+  * debian/control: updated Maintainer and Uploaders fields to match
+    reality.
+
+ -- Cyril Bouthors <cyril at bouthors.org>  Mon, 30 May 2005 11:22:46 +0300
+
+drbd (0.7.10-3) unstable; urgency=low
+
+  * (Cyril Bouthors)
+     - scripts/drbd: explicit modprobe and rmmod pathnames
+       (initscript_explicit_pathname.patch) (closes: #303060, #302556).
+
+ -- Cyril Bouthors <cyril at bouthors.org>  Sun, 17 Apr 2005 18:08:30 +0300
+
+drbd (0.7.10-2) unstable; urgency=low
+
+  * (Cyril Bouthors)
+     - debian/drbd0.7-utils.prerm: silently ignore the initscript return
+       code if we remove or deconfigure the package or carefully pay
+       attention to it if we upgrade the package. (closes: #295533).
+     - debian/control: fixed drbd0.7-module-source description.
+
+ -- Cyril Bouthors <cyril at bouthors.org>  Wed, 16 Feb 2005 21:05:51 +0100
+
+drbd (0.7.10-1) unstable; urgency=low
+
+  * (Cyril Bouthors)
      - New upstream release
 
- -- Philipp Reisner <phil at linbit.com>  Mon, 31 Jan 2005 10:17:00 +0100
+ -- Cyril Bouthors <cyril at bouthors.org>  Mon, 31 Jan 2005 17:29:27 +0300
 
-drbd (0.7.9-0) unstable; urgency=low
+drbd (0.7.9-2) unstable; urgency=low
 
-  * (Philipp Reisner)
+  * (Cyril Bouthors)
+     - Applied patch from Lars Marowsky-Bree <lmb at suse.de> that fixes a
+       "severe [...] memory corruption bug [...]".
+
+ -- Cyril Bouthors <cyril at bouthors.org>  Thu, 27 Jan 2005 13:55:00 +0300
+
+drbd (0.7.9-1) unstable; urgency=low
+
+  * (Cyril Bouthors)
      - New upstream release
 
- -- Philipp Reisner <phil at linbit.com>  Tue, 25 Jan 2005 11:31:00 +0100
+ -- Cyril Bouthors <cyril at bouthors.org>  Thu, 27 Jan 2005 11:35:19 +0300
 
 drbd (0.7.8-1) unstable; urgency=low
 

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/debian/control	2005-12-27 18:24:36 UTC (rev 2040)
@@ -1,9 +1,9 @@
 Source: drbd
 Section: admin
 Priority: extra
-Maintainer: David Krovich <dkrovich at csee.wvu.edu>
-Uploaders: Philipp Hug <debian at hug.cx>, Cyril Bouthors <cyril at bouthors.org>
-Build-Depends: debhelper (>= 4), debconf-utils, sp, docbook-utils, bison, flex
+Maintainer: Cyril Bouthors <cyril at bouthors.org>
+Uploaders: David Krovich <dkrovich at csee.wvu.edu>, Philipp Hug <debian at hug.cx>
+Build-Depends: debhelper (>= 4), debconf-utils, sp, docbook-utils, bison, flex, dpatch
 Standards-Version: 3.6.1
 
 Package: drbd0.7-utils
@@ -16,34 +16,32 @@
 Suggests: heartbeat
 Description: RAID 1 over tcp/ip for Linux utilities
  Drbd is a block device which is designed to build high availability
- clusters by providing a virtual shared device which keeps disks in nodes
- synchronised using TCP/IP. This simulates RAID 1 but avoiding the 
- use of uncommon hardware (shared SCSI buses or Fibre Channel). 
+ clusters by providing a virtual shared device which keeps disks in
+ nodes synchronised using TCP/IP. This simulates RAID 1 but avoiding
+ the use of uncommon hardware (shared SCSI buses or Fibre Channel).
  It is currently limited to fail-over HA clusters.
  .
- This package contains the programs that will control the 
- drbd kernel module provided in drbd-source. You will need a clustering
- service (such as heartbeat) to fully implement it.
+ This package contains the programs that will control the drbd kernel
+ module provided in drbd-source. You will need a clustering service
+ (such as heartbeat) to fully implement it.
  .
  Homepage: http://www.drbd.org
 
 Package: drbd0.7-module-source
 Architecture: all
 Section: admin
-Depends: module-assistant
+Depends: module-assistant, debhelper (>= 4), dpatch
 Conflicts: drbd-module-source, drbd-source
 Provides: drbd-module-source
 Replaces: drbd-module-source, drbd-source
 Recommends:  dpkg-dev, kernel-package, debhelper (>= 4), debconf-utils
 Description: RAID 1 over tcp/ip for Linux module source
  Drbd is a block device which is designed to build high availability
- clusters by providing a virtual shared device which keeps disks in nodes
- synchronised using TCP/IP. This simulates RAID 1 but avoiding the 
- use of uncommon hardware (shared SCSI buses or Fibre Channel). 
+ clusters by providing a virtual shared device which keeps disks in
+ nodes synchronised using TCP/IP. This simulates RAID 1 but avoiding
+ the use of uncommon hardware (shared SCSI buses or Fibre Channel).
  It is currently limited to fail-over HA clusters.
  .
- This package contains the programs that will control the 
- drbd kernel module provided in drbd-source. You will need a clustering
- service (such as heartbeat) to fully implement it.
+ This package contains the source code for the drbd kernel module.
  .
  Homepage: http://www.drbd.org

Modified: trunk/debian/drbd0.7-utils.prerm
===================================================================
--- trunk/debian/drbd0.7-utils.prerm	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/debian/drbd0.7-utils.prerm	2005-12-27 18:24:36 UTC (rev 2040)
@@ -1,6 +1,30 @@
 #!/bin/sh
 
-if [ -x "/etc/init.d/drbd" ]; then
-	/etc/init.d/drbd stop
+# This script silently ignores the initscript return code if we remove
+# or deconfigure the package or carefully pay attention to it if we
+# upgrade the package.
+
+# Cyril Bouthors <cyril at bouthors.org>
+# Wed Feb 16 21:01:11 CET 2005
+
+set -e
+
+if [ -x "/etc/init.d/drbd" ]
+then
+    case "$1" in
+	remove|deconfigure)
+	    /etc/init.d/drbd stop || true
+	    ;;
+
+	upgrade|failed-upgrade)
+	    /etc/init.d/drbd stop
+	    ;;
+
+	*)
+	    echo "prerm called with unknown argument \`$1'" >&2
+	    exit 0
+	    ;;
+    esac
 fi
+
 #DEBHELPER#

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/debian/rules	2005-12-27 18:24:36 UTC (rev 2040)
@@ -7,8 +7,10 @@
 # build-arch and build-indep targets  by Bill Allombert 2001
 
 # Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# export DH_VERBOSE=1
 
+include /usr/share/dpatch/dpatch.make
+
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
@@ -34,7 +36,7 @@
 KO=k
 endif
 
-kdist_clean:
+kdist_clean: unpatch
 	dh_clean
 	-$(MAKE) -C drbd clean
 
@@ -60,11 +62,11 @@
 	dh_md5sums
 	dh_builddeb --destdir=$(DEB_DESTDIR)
 
-#Architecture 
-build: build-arch build-indep
+#Architecture
+build: patch build-arch build-indep
 
 build-arch: build-arch-stamp
-build-arch-stamp: 
+build-arch-stamp:
 	dh_testdir
 	$(MAKE) -C user
 	$(MAKE) -C scripts
@@ -73,10 +75,10 @@
 	touch build-arch-stamp
 
 build-indep: build-indep-stamp
-build-indep-stamp: 
+build-indep-stamp:
 	touch build-indep-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
@@ -89,13 +91,13 @@
 	-$(MAKE) -C benchmark clean
 	-$(MAKE) -C documentation clean
 	-$(MAKE) -C drbd clean
-	dh_clean 
+	dh_clean
 
 install: install-arch install-indep
 install-indep:
 	dh_testdir
 	dh_testroot
-	dh_clean -k -i 
+	dh_clean -k -i
 	dh_installdirs -i
 	cp -a drbd/* debian/$(PACKAGE)-source/usr/src/modules/drbd/drbd
 	cp Makefile debian/$(PACKAGE)-source/usr/src/modules/drbd
@@ -115,7 +117,7 @@
 install-arch:
 	dh_testdir
 	dh_testroot
-	dh_clean -k -s 
+	dh_clean -k -s
 	dh_installdirs -s
 	$(MAKE) PREFIX=$(CURDIR)/debian/drbd0.7-utils/ -C user install
 	$(MAKE) PREFIX=$(CURDIR)/debian/drbd0.7-utils/ -C scripts install
@@ -133,8 +135,8 @@
 	dh_installdocs
 	dh_installexamples
 #	dh_installmenu
-#	dh_installdebconf	
-#	dh_installlogrotate	
+#	dh_installdebconf
+#	dh_installlogrotate
 #	dh_installemacsen
 #	dh_installpam
 #	dh_installmime
@@ -144,7 +146,7 @@
 	dh_installman
 	dh_link
 	dh_strip
-	dh_compress 
+	dh_compress
 	dh_fixperms
 #	dh_perl
 #	dh_python
@@ -163,4 +165,4 @@
 	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
 
 binary: binary-arch binary-indep
-.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch
+.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch patch unpatch

Modified: trunk/documentation/Makefile
===================================================================
--- trunk/documentation/Makefile	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/documentation/Makefile	2005-12-27 18:24:36 UTC (rev 2040)
@@ -28,7 +28,7 @@
 
 MAKEFILES_LANG := $(foreach dir,$(LANGS),$(dir)/Makefile)
 
-MANPAGES       := drbdsetup.8 drbd.conf.5 drbd.8 drbdadm.8
+MANPAGES       := drbdsetup.8 drbd.conf.5 drbd.8 drbdadm.8 drbddisk.8
 
 #
 # Docbook Magic for SuSE, Worksforme...

Modified: trunk/documentation/drbd.conf.sgml
===================================================================
--- trunk/documentation/drbd.conf.sgml	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/documentation/drbd.conf.sgml	2005-12-27 18:24:36 UTC (rev 2040)
@@ -79,7 +79,7 @@
   is considered
   as part of the parameters value. A special case are Boolean
   parameters which only consist of the identifier.
-  Parameters are terminated by a semikolon (<quote>;</quote>).
+  Parameters are terminated by a semicolon (<quote>;</quote>).
   </para>
   <para>Some parameter values have default units which might be overruled
   by K, M or G. These units are defined in the usual way (K = 2^10 = 1024,
@@ -111,7 +111,7 @@
   <listitem><para>
     Configures some global parameters. Currently only
     <option>minor-count</option>, <option>dialog-refresh</option> 
-    and <option>disable-io-hints</option>
+    and <option>disable-ip-verification</option>
     are allowed here. You may only have one global section, preferably
     as the first section.
   </para>
@@ -155,7 +155,8 @@
     refer to <citerefentry><refentrytitle>drbdsetup</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry> for detailed description of 
     the parameters.
-    Optional parameter: <option>on-io-error</option>.
+    Optional parameter: <option>on-io-error</option>,
+    <option>size</option>.
   </para>
   </listitem>
 </varlistentry>
@@ -218,7 +219,7 @@
   <para>Use <replaceable>minor-count</replaceable>
    if you want to define more resources later without reloading the DRBD kernel
    module. Per default the module loads with exactly as many devices as
-   configured in this file. Builtin default for module is 2, and 8 for
+   configured in this file. Built-in default for module is 2, and 8 for
    monolithic kernel. For monolithic kernel
    <replaceable>minor-count</replaceable> is ignored, and you have to pass a
    kernel boot parameter <replaceable>drbd.minor_count=count</replaceable> to
@@ -238,13 +239,13 @@
 </varlistentry>
 
 <varlistentry>
-  <term><option>disable-io-hints</option></term>
+  <term><option>disable-ip-verification</option></term>
   <listitem>
-  <para>Use <replaceable>disable-io-hints</replaceable>
-   if you want to set up a DRBD device via the
-   loopback network interface or between two virtual machines on the same
-   box, for testing/simulating/presentationn
-   otherwise it could trigger a run_tasq_queue deadlock.</para>
+  <para>Use <replaceable>disable-ip-verification</replaceable>
+   if, for some obscure reasons, drbdadm can/might not use ip or ifconfig
+   to do a sanity check for the IP address, you can disable it with this
+   this option.
+   </para>
    </listitem>
 </varlistentry>
 
@@ -254,7 +255,7 @@
   <para>On the TCP/IP link the specified <replaceable>protocol</replaceable>
   is used. Valid protocol specifiers are A, B, and C.</para>
   <para>Protocol A: write IO is reported as completed, if it has
-  reached local disk and local tcp send buffer.</para>
+  reached local disk and local TCP send buffer.</para>
   <para>Protocol B: write IO is reported as completed, if it has reached
   local disk and remote buffer cache.</para>
   <para>Protocol C: write IO is reported as completed, if it has
@@ -265,7 +266,7 @@
 <varlistentry>
   <term><option>incon-degr-cmd <replaceable>command</replaceable></option></term>
   <listitem><para>
-    In case a node starts up in degraded mode (inittimeout is set) and
+    In case a node starts up in degraded mode (degr-wfc-timeout is set) and
     its local replica of the data is inconsistent it executes the
     <replaceable>command</replaceable>. If the command exits without
     error, drbddisk expects the DRBD device to be in primary state.
@@ -408,7 +409,7 @@
   Maximal number of requests to be allocated by DRBD. Unit is PAGE_SIZE,
   which is 4 KB on most systems.
   The minimum is hardcoded to 32 (=128 KB).
-  For hight performance installations it might help, if you
+  For high performance installations it might help, if you
   increase that number. These buffers are used to hold
   datablocks while they are written to disk.
   </para></listitem>
@@ -526,7 +527,7 @@
 </refsect1>
 <refsect1>
 <title>Version</title>
-<simpara>This document is correct for version 0.7.5 of the DRBD distribution.
+<simpara>This document is correct for version 0.7.13 of the DRBD distribution.
 </simpara>
 </refsect1>
 <refsect1>
@@ -543,7 +544,7 @@
 <refsect1>
 <title>Copyright</title>
 <simpara>
-Copyright (c) 2001 Philipp Reisner. This  is  free software; 
+Copyright (c) 2001-2005 Philipp Reisner. This  is  free software; 
 see the source for copying conditions.  There is NO warranty; 
 not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 </simpara>

Modified: trunk/documentation/drbd.sgml
===================================================================
--- trunk/documentation/drbd.sgml	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/documentation/drbd.sgml	2005-12-27 18:24:36 UTC (rev 2040)
@@ -20,6 +20,9 @@
       <arg choice=req>start</arg>
       <arg choice=req>stop</arg>
       <arg choice=req>status</arg>
+      <arg choice=req>reload</arg>
+      <arg choice=req>restart</arg>
+      <arg choice=req>force-reload</arg>
     </group>
     </arg>
  </cmdsynopsis>
@@ -49,6 +52,12 @@
 </refsect1>
 
 <refsect1>
+  <title>Version</title>
+  <simpara>This document is correct for version 0.7.13 of the DRBD distribution.
+  </simpara>
+</refsect1>
+
+<refsect1>
   <title>Author</title>
   <simpara>
     Written by Philipp Reisner <email>philipp.reisner at linbit.com</email>.
@@ -65,9 +74,9 @@
 <refsect1>
   <title>Copyright</title>
   <simpara>
-    Copyright (c) 2001 Philipp Reisner. This  is  free software; 
+    Copyright (c) 2001-2005 Philipp Reisner. This  is  free software; 
     see the source for copying conditions.  There is NO warranty; 
-    not even for MERCHANTABILIT  or FITNESS FOR A PARTICULAR PURPOSE.
+    not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   </simpara>
 </refsect1>
 
@@ -76,10 +85,12 @@
   <para>
     <citerefentry><refentrytitle>drbd.conf</refentrytitle>
     <manvolnum>5</manvolnum></citerefentry>,
-    <citerefentry><refentrytitle>datadisk</refentrytitle>
+    <citerefentry><refentrytitle>drbddisk</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry>,
     <citerefentry><refentrytitle>drbdsetup</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry>
+    <citerefentry><refentrytitle>drbdadm</refentrytitle>
+    <manvolnum>8</manvolnum></citerefentry>
   </para>
 </refsect1>
 

Modified: trunk/documentation/drbdadm.sgml
===================================================================
--- trunk/documentation/drbdadm.sgml	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/documentation/drbdadm.sgml	2005-12-27 18:24:36 UTC (rev 2040)
@@ -51,8 +51,8 @@
           <replaceable>file</replaceable></term>
         <listitem><para>
           Specifies the configuration file drbdadm will use. If this parameter
-	  is not specified, drbdadm will look for /etc/drbd-07.conf and
-          /etc/drbd.conf.
+	  is not specified, drbdadm will look for <option>/etc/drbd-07.conf</option> and
+          <option>/etc/drbd.conf</option>.
 	</para></listitem>
       </varlistentry>
       <varlistentry>
@@ -60,7 +60,7 @@
           <replaceable>file</replaceable></term>
         <listitem><para>
           Specifies the full path to the drbdsetup program. If this option is
-	  omitted, drbdadm will look for /sbin/drbdsetup and ./drbdsetup.
+	  omitted, drbdadm will look for <option>/sbin/drbdsetup</option> and <option>./drbdsetup</option>.
 	</para></listitem>
       </varlistentry>
       <varlistentry>
@@ -106,7 +106,7 @@
       <varlistentry>
         <term>syncer</term>
         <listitem><para>
-          Loads the resynchronisation parameters into the device.
+          Loads the resynchronization parameters into the device.
         </para></listitem>
       </varlistentry>
       <varlistentry>
@@ -148,7 +148,7 @@
       <varlistentry>
         <term>invalidate_remote</term>
         <listitem><para>
-          This command is simmilar to the invalidate command, but the
+          This command is similar to the invalidate command, but the
 	  backing storage of the peer is invalidated and hence rewritten
 	  with the data of the local node.
         </para></listitem>
@@ -156,7 +156,7 @@
       <varlistentry>
         <term>resize</term>
         <listitem><para>
-          DRBD will reexamine all sizing constraints, and resize the
+          DRBD will reexamine all sizing constraints, and re-size the
 	  resource's device accordingly. E.g. in case you increased the
 	  size of your backing storage devices (on both nodes of course),
 	  then DRBD will adopt to the new size after you called 
@@ -237,7 +237,7 @@
   <refsect1>
     <title>Version</title>
     <simpara>
-      This document is correct for version 0.7 of the DRBD distribution.
+      This document is correct for version 0.7.13 of the DRBD distribution.
     </simpara>
   </refsect1>
 
@@ -254,7 +254,7 @@
   <refsect1>
     <title>Copyright</title>
     <simpara>
-      Copyright (c) 2004 Philipp Reisner. This  is  free software; 
+      Copyright (c) 2004-2005 Philipp Reisner. This  is  free software; 
       see the source for copying conditions.  There is NO warranty; 
       not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     </simpara>
@@ -268,6 +268,8 @@
       <manvolnum>8</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>drbddisk</refentrytitle>
       <manvolnum>8</manvolnum></citerefentry>
+      <citerefentry><refentrytitle>drbdsetup</refentrytitle>
+      <manvolnum>8</manvolnum></citerefentry>
     </para>
   </refsect1>
 </refentry>

Copied: trunk/documentation/drbddisk.sgml (from rev 1944, branches/drbd-0.7/documentation/drbddisk.sgml)

Modified: trunk/documentation/drbdsetup.sgml
===================================================================
--- trunk/documentation/drbdsetup.sgml	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/documentation/drbdsetup.sgml	2005-12-27 18:24:36 UTC (rev 2040)
@@ -620,7 +620,7 @@
 
   <refsect1>
     <title>Version</title>
-    <simpara>This document is intended to be correct for version 0.7.x of the DRBD distribution.
+    <simpara>This document is correct for version 0.7.13 of the DRBD distribution.
     </simpara>
   </refsect1>
 
@@ -637,7 +637,7 @@
   <refsect1>
     <title>Copyright</title>
     <simpara>
-      Copyright (c) 2001 Philipp Reisner. This  is  free software; 
+      Copyright (c) 2001-2005 Philipp Reisner. This  is  free software; 
       see the source for copying conditions.  There is NO warranty; 
       not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     </simpara>
@@ -649,8 +649,10 @@
       <manvolnum>5</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>drbd</refentrytitle>
       <manvolnum>8</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>datadisk</refentrytitle>
+      <citerefentry><refentrytitle>drbddisk</refentrytitle>
       <manvolnum>8</manvolnum></citerefentry>
+      <citerefentry><refentrytitle>drbdadm</refentrytitle>
+      <manvolnum>8</manvolnum></citerefentry>
     </para>
   </refsect1>
 </refentry>

Modified: trunk/drbd/Makefile
===================================================================
--- trunk/drbd/Makefile	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/Makefile	2005-12-27 18:24:36 UTC (rev 2040)
@@ -99,7 +99,8 @@
 	  fi;									\
 	  grep return $@ ;							\
 	else									\
-	  echo -ne "\treturn \"SVN Revision: "; svnversion -n ..; echo \";	\
+	  SVNREV=$$(svnversion -n -c ..);					\
+	  echo -e "\treturn \"SVN Revision: $${SVNREV##*:}\"";	 		\
 	fi ;									\
 	echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";	\
        	mv $@{.new,}
@@ -143,11 +144,13 @@
 # install -d $(PREFIX)/var/lib/drbd
 	install -d $(PREFIX)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR)
 	install -m 644 $(MODOBJ) $(PREFIX)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR)
-    ifeq ($(shell uname -r),$(KERNELRELEASE))
+    ifeq ($(PREFIX),/)
+      ifeq ($(shell uname -r),$(KERNELRELEASE))
 	/sbin/depmod -a || /sbin/depmod -e $(MODOBJ) 2>&1 >/dev/null || true
-    else
+      else
 	[ -e $(LINUX)/System.map ] && \
 	   /sbin/depmod -F $(LINUX)/System.map -e ./$(MODOBJ) 2>&1 >/dev/null || true
+      endif
     endif
   else
     install:

Modified: trunk/drbd/drbd_actlog.c
===================================================================
--- trunk/drbd/drbd_actlog.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_actlog.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -689,8 +689,10 @@
 		// we need the lock for drbd_try_clear_on_disk_bm
 		if(jiffies - mdev->rs_mark_time > HZ*10) {
 			/* should be roling marks, but we estimate only anyways. */
-			mdev->rs_mark_time = jiffies;
-			mdev->rs_mark_left = drbd_bm_total_weight(mdev);
+			if( mdev->rs_mark_left != drbd_bm_total_weight(mdev)) {
+				mdev->rs_mark_time =jiffies;
+				mdev->rs_mark_left =drbd_bm_total_weight(mdev);
+			}
 		}
 		drbd_try_clear_on_disk_bm(mdev,sector,count);
 		/* just wake_up unconditional now,

Modified: trunk/drbd/drbd_bitmap.c
===================================================================
--- trunk/drbd/drbd_bitmap.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_bitmap.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -323,7 +323,7 @@
 	unsigned long bits, bytes, words, *nbm, *obm = 0;
 	int err = 0, growing;
 
-	D_BUG_ON(!b);
+	ERR_IF(!b) return -ENOMEM;
 	MUST_BE_LOCKED();
 
 	ERR_IF (down_trylock(&b->bm_change)) {
@@ -429,9 +429,7 @@
 	unsigned long s;
 	unsigned long flags;
 
-	D_BUG_ON(!b);
-	if (b->bm_bits == 0) return 0;
-	D_BUG_ON(!b->bm);
+	ERR_IF(!b) return 0;
 	// MUST_BE_LOCKED(); well. yes. but ...
 
 	spin_lock_irqsave(&b->bm_lock,flags);
@@ -444,9 +442,7 @@
 size_t drbd_bm_words(drbd_dev *mdev)
 {
 	struct drbd_bitmap *b = mdev->bitmap;
-	D_BUG_ON(!b);
-	if (b->bm_words == 0) return 0;
-	D_BUG_ON(!b->bm);
+	ERR_IF(!b) return 0;
 
 	/* FIXME
 	 * actually yes. really. otherwise it could just change its size ...
@@ -469,7 +465,8 @@
 	size_t n = number;
 
 	if (number == 0) return;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return;
+	ERR_IF(!b->bm) return;
 	D_BUG_ON(offset        >= b->bm_words);
 	D_BUG_ON(offset+number >  b->bm_words);
 	D_BUG_ON(number > PAGE_SIZE/sizeof(long));
@@ -509,7 +506,8 @@
 	size_t n = number;
 
 	if (number == 0) return;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return;
+	ERR_IF(!b->bm) return;
 	D_BUG_ON(offset        >= b->bm_words);
 	D_BUG_ON(offset+number >  b->bm_words);
 	D_BUG_ON(number > PAGE_SIZE/sizeof(long));
@@ -547,7 +545,8 @@
 	unsigned long *bm;
 
 	if (number == 0) return;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return;
+	ERR_IF(!b->bm) return;
 	if ( (offset        >= b->bm_words) ||
 	     (offset+number >  b->bm_words) ||
 	     (number > PAGE_SIZE/sizeof(long)) ||
@@ -573,6 +572,8 @@
 void drbd_bm_set_all(drbd_dev *mdev)
 {
 	struct drbd_bitmap *b = mdev->bitmap;
+	ERR_IF(!b) return;
+	ERR_IF(!b->bm) return;
 
 	D_BUG_ON(!b);
 	if (b->bm_bits == 0) return;
@@ -722,9 +723,8 @@
 {
 	struct drbd_bitmap *b = mdev->bitmap;
 
-	D_BUG_ON(!b);
-	if (b->bm_bits == 0) return;
-	D_BUG_ON(!b->bm);
+	ERR_IF(!b) return;
+	ERR_IF(!b->bm) return;
 
 	MUST_BE_LOCKED();						\
 
@@ -739,7 +739,7 @@
 {
 	struct drbd_bitmap *b = mdev->bitmap;
 
-	D_BUG_ON(!b);
+	ERR_IF(!b) return;
 
 	MUST_BE_LOCKED();
 
@@ -760,11 +760,9 @@
 	struct drbd_bitmap *b = mdev->bitmap;
 	unsigned long i = -1UL;
 
+	ERR_IF(!b) return i;
+	ERR_IF(!b->bm) return i;
 
-	D_BUG_ON(!b);
-	if (b->bm_bits == 0) return i;
-	D_BUG_ON(!b->bm);
-
 	spin_lock_irq(&b->bm_lock);
 	BM_PARANOIA_CHECK();
 	if (b->bm_fo < b->bm_bits) {
@@ -809,7 +807,8 @@
 {
 	struct drbd_bitmap *b = mdev->bitmap;
 	int i;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return 1;
+	ERR_IF(!b->bm) return 1;
 
 /*
  * only called from drbd_set_out_of_sync.
@@ -843,7 +842,8 @@
 {
 	struct drbd_bitmap *b = mdev->bitmap;
 	int i;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return 0;
+	ERR_IF(!b->bm) return 0;
 
 	spin_lock_irq(&b->bm_lock);
 	BM_PARANOIA_CHECK();
@@ -876,7 +876,8 @@
 {
 	struct drbd_bitmap *b = mdev->bitmap;
 	int i;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return 0;
+	ERR_IF(!b->bm) return 0;
 
 	spin_lock_irq(&b->bm_lock);
 	BM_PARANOIA_CHECK();
@@ -910,7 +911,8 @@
 	int count, s, e;
 	unsigned long flags;
 
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return 0;
+	ERR_IF(!b->bm) return 0;
 	spin_lock_irqsave(&b->bm_lock,flags);
 	BM_PARANOIA_CHECK();
 
@@ -937,7 +939,8 @@
 	struct drbd_bitmap *b = mdev->bitmap;
 	unsigned long weight;
 	int count, s, e;
-	D_BUG_ON(!(b && b->bm));
+	ERR_IF(!b) return 0;
+	ERR_IF(!b->bm) return 0;
 
 	MUST_BE_LOCKED();
 

Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_fs.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -65,6 +65,7 @@
 	// TODO: should only be some assert here, not (re)init...
 	drbd_md_set_sector_offsets(mdev,mdev->bc);
 	rv = do_determin_dev_size(mdev);
+	if (rv < 0) goto out;
 
 	la_size_changed = (la_size != mdev->bc->md.la_size_sect);
 
@@ -83,6 +84,7 @@
 		// Write mdev->bc->md.la_size_sect to [possibly new position on] disk.
 		drbd_md_write(mdev);
 	}
+  out:
 	lc_unlock(mdev->act_log);
 
 	return rv;
@@ -103,7 +105,9 @@
 }
 
 
-/* Returns 1 if there is a disk-less node, 0 if both nodes have a disk. */
+/* Returns 1 if there is a disk-less node, 0 if both nodes have a disk.
+ * -ENOMEM if we could not allocate the bitmap
+ */
 /*
  * *_size is in sectors.
  *
@@ -162,7 +166,7 @@
 			/* currently there is only one error: ENOMEM! */
 			size = drbd_bm_capacity(mdev)>>1;
 			if (size == 0) {
-				ERR("Could not allocate bitmap! Set device size => 0\n");
+				ERR("OUT OF MEMORY! Could not allocate bitmap! Set device size => 0\n");
 			} else {
 				/* FIXME this is problematic,
 				 * if we in fact are smaller now! */
@@ -170,6 +174,7 @@
 				    "Leaving size unchanged at size = %lu KB\n",
 				    (unsigned long)size);
 			}
+			rv = err;
 		}
 		// racy, see comments above.
 		drbd_set_my_capacity(mdev,size);

Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_int.h	2005-12-27 18:24:36 UTC (rev 2040)
@@ -1115,7 +1115,7 @@
 
 // drbd_proc.c
 extern struct proc_dir_entry *drbd_proc;
-extern int drbd_proc_get_info(char *, char **, off_t, int, int *, void *);
+extern struct file_operations drbd_proc_fops;
 extern const char* conns_to_name(drbd_conns_t s);
 extern const char* roles_to_name(drbd_role_t s);
 

Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_main.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -791,8 +791,10 @@
 	daemonize("drbd_thread");
 	D_ASSERT(get_t_state(thi) == Running);
 	D_ASSERT(thi->task == NULL);
+	spin_lock(&thi->t_lock);
 	thi->task = current;
 	smp_mb();
+	spin_unlock(&thi->t_lock);
 	complete(&thi->startstop); // notify: thi->task is set.
 
 	retval = thi->function(thi);
@@ -1848,6 +1850,7 @@
 	mdev->net_conf     = NULL;
 	mdev->send_task    = NULL;
 	drbd_set_my_capacity(mdev,0);
+	drbd_bm_resize(mdev,0);
 
 	// just in case
 	drbd_free_resources(mdev);
@@ -2256,13 +2259,14 @@
 	/*
 	 * register with procfs
 	 */
-	// XXX maybe move to a seq_file interface
-	drbd_proc = create_proc_read_entry("drbd", 0, &proc_root,
-					   drbd_proc_get_info, NULL);
+	drbd_proc = create_proc_entry("drbd",  S_IFREG | S_IRUGO , &proc_root);
+
 	if (!drbd_proc)	{
 		printk(KERN_ERR DEVICE_NAME": unable to register proc file\n");
 		goto Enomem;
 	}
+	
+	drbd_proc->proc_fops = &drbd_proc_fops;
 	drbd_proc->owner = THIS_MODULE;
 #else
 # error "Currently drbd depends on the proc file system (CONFIG_PROC_FS)"

Modified: trunk/drbd/drbd_proc.c
===================================================================
--- trunk/drbd/drbd_proc.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_proc.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -35,13 +35,22 @@
 #include <linux/file.h>
 #include <linux/slab.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/drbd.h>
 #include "drbd_int.h"
 #include "lru_cache.h" /* for lc_sprintf_stats */
 
-int drbd_proc_get_info(char *, char **, off_t, int, int *, void *);
+STATIC int drbd_proc_open(struct inode *inode, struct file *file);
 
+
 struct proc_dir_entry *drbd_proc;
+struct file_operations drbd_proc_fops = {
+	.owner		= THIS_MODULE,
+	.open		= drbd_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 
 /*lge
  * progress bars shamelessly adapted from driver/md/md.c
@@ -49,9 +58,8 @@
  *	[=====>..............] 33.5% (23456/123456)
  *	finish: 2:20:20 speed: 6,345 (6,456) K/sec
  */
-STATIC int drbd_syncer_progress(struct Drbd_Conf* mdev,char *buf)
+STATIC void drbd_syncer_progress(struct Drbd_Conf* mdev, struct seq_file *seq)
 {
-	int sz = 0;
 	unsigned long res , db, dt, dbdt, rt, rs_left;
 
 	/* the whole sector_div thingy was wrong (did overflow,
@@ -83,23 +91,23 @@
 	}
 	{
 		int i, y = res/50, x = 20-y;
-		sz += sprintf(buf + sz, "\t[");
+		seq_printf(seq, "\t[");
 		for (i = 1; i < x; i++)
-			sz += sprintf(buf + sz, "=");
-		sz += sprintf(buf + sz, ">");
+			seq_printf(seq, "=");
+		seq_printf(seq, ">");
 		for (i = 0; i < y; i++)
-			sz += sprintf(buf + sz, ".");
-		sz += sprintf(buf + sz, "] ");
+			seq_printf(seq, ".");
+		seq_printf(seq, "] ");
 	}
 	res = 1000L - res;
-	sz+=sprintf(buf+sz,"sync'ed:%3lu.%lu%% ", res / 10, res % 10);
+	seq_printf(seq,"sync'ed:%3lu.%lu%% ", res / 10, res % 10);
 	/* if more than 1 GB display in MB */
 	if (mdev->rs_total > 0x100000L) {
-		sz+=sprintf(buf+sz,"(%lu/%lu)M\n\t",
+		seq_printf(seq,"(%lu/%lu)M\n\t",
 			    (unsigned long) Bit2KB(rs_left) >> 10,
 			    (unsigned long) Bit2KB(mdev->rs_total) >> 10 );
 	} else {
-		sz+=sprintf(buf+sz,"(%lu/%lu)K\n\t",
+		seq_printf(seq,"(%lu/%lu)K\n\t",
 			    (unsigned long) Bit2KB(rs_left),
 			    (unsigned long) Bit2KB(mdev->rs_total) );
 	}
@@ -114,20 +122,28 @@
 	 * rt: remaining time
 	 */
 	dt = (jiffies - mdev->rs_mark_time) / HZ;
+
+	if (dt > 20) {
+		/* if we made no update to rs_mark_time for too long,
+		 * we are stalled. show that. */
+		seq_printf(seq, "stalled\n");
+		return;
+	}
+
 	if (!dt) dt++;
 	db = mdev->rs_mark_left - rs_left;
 	rt = (dt * (rs_left / (db/100+1)))/100; /* seconds */
 
-	sz += sprintf(buf + sz, "finish: %lu:%02lu:%02lu",
+	seq_printf(seq, "finish: %lu:%02lu:%02lu",
 		rt / 3600, (rt % 3600) / 60, rt % 60);
 
 	/* current speed average over (SYNC_MARKS * SYNC_MARK_STEP) jiffies */
 	dbdt = Bit2KB(db/dt);
 	if (dbdt > 1000)
-		sz += sprintf(buf + sz, " speed: %ld,%03ld",
+		seq_printf(seq, " speed: %ld,%03ld",
 			dbdt/1000,dbdt % 1000);
 	else
-		sz += sprintf(buf + sz, " speed: %ld", dbdt);
+		seq_printf(seq, " speed: %ld", dbdt);
 
 	/* mean speed since syncer started
 	 * we do account for PausedSync periods */
@@ -136,26 +152,22 @@
 	db = mdev->rs_total - rs_left;
 	dbdt = Bit2KB(db/dt);
 	if (dbdt > 1000)
-		sz += sprintf(buf + sz, " (%ld,%03ld)",
+		seq_printf(seq, " (%ld,%03ld)",
 			dbdt/1000,dbdt % 1000);
 	else
-		sz += sprintf(buf + sz, " (%ld)", dbdt);
+		seq_printf(seq, " (%ld)", dbdt);
 
-	sz += sprintf(buf+sz," K/sec\n");
-
-	return sz;
+	seq_printf(seq," K/sec\n");
 }
 
-/* FIXME we should use snprintf, we only have guaranteed room for one page...
- * we should eventually use seq_file for this */
-int drbd_proc_get_info(char *buf, char **start, off_t offset,
-		       int len, int *unused, void *data)
+
+STATIC int drbd_seq_show(struct seq_file *seq, void *v)
 {
-	int rlen, i;
+	int i;
 	const char *sn;
 
-	rlen = sprintf(buf, "version: " REL_VERSION " (api:%d/proto:%d)\n%s\n",
-		       API_VERSION,PRO_VERSION, drbd_buildtag());
+	seq_printf(seq, "version: " REL_VERSION " (api:%d/proto:%d)\n%s\n",
+		    API_VERSION,PRO_VERSION, drbd_buildtag());
 
 	/*
 	  cs .. connection state
@@ -175,10 +187,9 @@
 
 		if ( drbd_conf[i].state.conn == StandAlone &&
 		     drbd_conf[i].state.disk == Diskless) {
-			rlen += sprintf( buf + rlen,
-			   "%2d: Unconfigured\n", i);
-		} else {
-			rlen += sprintf( buf + rlen,
+			seq_printf( seq, "%2d: cs:Unconfigured\n", i);
+		else
+			seq_printf( seq,
 			   "%2d: cs:%s st:%s/%s ds:%s/%s\n"
 			   "    ns:%u nr:%u dw:%u dr:%u al:%u bm:%u "
 			   "lo:%d pe:%d ua:%d ap:%d\n",
@@ -200,20 +211,20 @@
 			   atomic_read(&drbd_conf[i].ap_bio_cnt)
 			);
 
-			if ( drbd_conf[i].state.conn == SyncSource ||
-			     drbd_conf[i].state.conn == SyncTarget ) {
-				rlen += drbd_syncer_progress(drbd_conf+i,buf+rlen);
-			}
+		if ( drbd_conf[i].cstate == SyncSource ||
+		     drbd_conf[i].cstate == SyncTarget )
+			drbd_syncer_progress(drbd_conf+i,seq);
 
-			rlen += lc_sprintf_stats(buf+rlen,drbd_conf[i].resync);
-			rlen += lc_sprintf_stats(buf+rlen,drbd_conf[i].act_log);
-		}
-
+		lc_printf_stats(seq,drbd_conf[i].resync);
+		lc_printf_stats(seq,drbd_conf[i].act_log);
 	}
 
-	/* DEBUG & profile stuff end */
+	return 0;
+}
 
-	return rlen;
+STATIC int drbd_proc_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, drbd_seq_show, PDE(inode)->data);
 }
 
 /* PROC FS stuff end */

Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/drbd_receiver.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -536,6 +536,7 @@
 {
 	int err;
 	struct socket *sock;
+	struct sockaddr_in src_in;
 
 	err = sock_create(AF_INET, SOCK_STREAM, 0, &sock);
 	if (err) {
@@ -548,6 +549,26 @@
 	sock->sk->sk_rcvtimeo =
 	sock->sk->sk_sndtimeo =  mdev->net_conf->try_connect_int*HZ;
 
+       /* explicitly bind to the configured IP as source IP 
+	   for the outgoing connections.
+	   This is needed for multihomed hosts and to be 
+	   able to use lo: interfaces for drbd.
+          Make sure to use 0 as portnumber, so linux selects
+	   a free one dynamically.
+	*/
+	memcpy (&src_in, &(mdev->conf.my_addr), sizeof(struct sockaddr_in));
+	src_in.sin_port = 0; 
+
+	err = sock->ops->bind(sock,
+			      (struct sockaddr * ) &src_in,
+			      sizeof (struct sockaddr_in));
+	if (err) {
+		ERR("Unable to bind source sock (%d)\n", err);
+		sock_release(sock);
+		sock = NULL;
+		return sock;
+	}
+
 	err = sock->ops->connect(sock,
 				 (struct sockaddr *)mdev->net_conf->other_addr,
 				 mdev->net_conf->other_addr_len, 0);
@@ -569,7 +590,7 @@
 	err = sock_create(AF_INET, SOCK_STREAM, 0, &sock2);
 	if (err) {
 		ERR("sock_creat(..)=%d\n", err);
-		// FIXME return NULL ?
+		return NULL;
 	}
 
 	if(!inc_net(mdev)) return NULL;
@@ -584,7 +605,7 @@
 	dec_net(mdev);
 
 	if (err) {
-		ERR("Unable to bind (%d)\n", err);
+		ERR("Unable to bind sock2 (%d)\n", err);
 		sock_release(sock2);
 		drbd_force_state(mdev,NS(conn,Unconnected));
 		return NULL;
@@ -599,9 +620,17 @@
 STATIC int drbd_do_handshake(drbd_dev *mdev);
 STATIC int drbd_do_auth(drbd_dev *mdev);
 
+/*
+ * return values:
+ *   1 yess, we have a valid connection
+ *   0 oops, did not work out, please try again
+ *  -1 peer talks different language,
+ *     no point in trying again, please go standalone.
+ */
 int drbd_connect(drbd_dev *mdev)
 {
 	struct socket *sock,*msock;
+	int h;
 
 	D_ASSERT(mdev->state.conn > StandAlone);
 	D_ASSERT(!mdev->data.socket);
@@ -634,12 +663,12 @@
 				sock_release(sock);
 			}
 		}
-		if(mdev->state.conn == Unconnected) return 0;
+		if(mdev->state.conn == Unconnected) return -1;
 		if(signal_pending(current)) {
 			flush_signals(current);
 			smp_rmb();
 			if (get_t_state(&mdev->receiver) == Exiting)
-				return 0;
+				return -1;
 		}
 	}
 
@@ -679,9 +708,8 @@
 	if(drbd_request_state(mdev,NS(conn,WFReportParams)) <= 0) return 0;
 	D_ASSERT(mdev->asender.task == NULL);
 
-	if (!drbd_do_handshake(mdev)) {
-		return 0;
-	}
+	h = drbd_do_handshake(mdev);
+	if (h <= 0) return h;
 
 	if ( mdev->cram_hmac_tfm ) {
 		if (!drbd_do_auth(mdev)) {
@@ -2104,7 +2132,7 @@
 	ok = drbd_request_state(mdev,NS(conn,WFSyncUUID));
 	D_ASSERT( ok == 1 );
 	drbd_bm_unlock(mdev);
-	return TRUE; // cannot fail ?
+	return ok == 1 ? TRUE : FALSE;
 }
 
 STATIC int receive_BecomeSyncSource(drbd_dev *mdev, Drbd_Header *h)
@@ -2115,7 +2143,7 @@
 	drbd_bm_write(mdev);
 	drbd_start_resync(mdev,SyncSource);
 	drbd_bm_unlock(mdev);
-	return TRUE; // cannot fail ?
+	return TRUE;
 }
 
 STATIC int receive_pause_resync(drbd_dev *mdev, Drbd_Header *h)
@@ -2411,6 +2439,13 @@
 	return ok;
 }
 
+/*
+ * return values:
+ *   1 yess, we have a valid connection
+ *   0 oops, did not work out, please try again
+ *  -1 peer talks different language,
+ *     no point in trying again, please go standalone.
+ */
 STATIC int drbd_do_handshake(drbd_dev *mdev)
 {
 	// ASSERT current == mdev->receiver ...
@@ -2427,13 +2462,13 @@
 	if (p->head.command != HandShake) {
 		ERR( "expected HandShake packet, received: %s (0x%04x)\n",
 		     cmdname(p->head.command), p->head.command );
-		return 0;
+		return -1;
 	}
 
 	if (p->head.length != expect) {
 		ERR( "expected HandShake length: %u, received: %u\n",
 		     expect, p->head.length );
-		return 0;
+		return -1;
 	}
 
 	rv = drbd_recv(mdev, &p->head.payload, expect);
@@ -2465,7 +2500,7 @@
 		ERR( "incompatible DRBD dialects: "
 		     "I support %u, peer wants %u\n",
 		     PRO_VERSION, p->protocol_version );
-		return 0;
+		return -1;
 	}
 
 	return 1;
@@ -2603,19 +2638,26 @@
 	enum disconnect_handler on_disconnect = Reconnect;
 	drbd_dev *mdev = thi->mdev;
 	int minor = (int)(mdev-drbd_conf);
+	int h;
 
 	sprintf(current->comm, "drbd%d_receiver", minor);
 
 	/* printk(KERN_INFO DEVICE_NAME ": receiver living/m=%d\n", minor); */
 
 	while (TRUE) {
-		if (!drbd_connect(mdev)) {
-			WARN("Discarding network configuration.\n");
+		h = drbd_connect(mdev);
+		if (h <= 0) {
 			/* FIXME DISKLESS StandAlone
 			 * does not make much sense...
 			 * drbd_disconnect should set cstate properly...
 			 */
 			drbd_disconnect(mdev);
+			if (h == 0) {
+				schedule_timeout(HZ);
+				continue;
+			}
+
+			WARN("Discarding network configuration.\n");
 			drbd_force_state(mdev,NS(conn,StandAlone));
 			break;
 		}

Modified: trunk/drbd/lru_cache.c
===================================================================
--- trunk/drbd/lru_cache.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/lru_cache.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -85,7 +85,7 @@
 	vfree(lc);
 }
 
-size_t	lc_sprintf_stats(char* buf, struct lru_cache* lc)
+size_t	lc_printf_stats(struct seq_file *seq, struct lru_cache* lc)
 {
 	/* NOTE:
 	 * total calls to lc_get are
@@ -93,7 +93,7 @@
 	 * misses include "dirty" count (update from an other thread in progress)
 	 * and "changed", when this in fact lead to an successful update of the cache.
 	 */
-	return sprintf(buf,"\t%s: elements:%u "
+	return seq_printf(seq,"\t%s: elements:%u "
 		"hits:%lu misses:%lu starving:%lu dirty:%lu changed:%lu\n",
 		lc->name, lc->nr_elements,
 		lc->hits, lc->misses, lc->starving, lc->dirty, lc->changed);

Modified: trunk/drbd/lru_cache.h
===================================================================
--- trunk/drbd/lru_cache.h	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd/lru_cache.h	2005-12-27 18:24:36 UTC (rev 2040)
@@ -107,7 +107,7 @@
 extern unsigned int       lc_put (struct lru_cache* lc, struct lc_element* e);
 extern void            lc_changed(struct lru_cache* lc, struct lc_element* e);
 
-extern size_t lc_sprintf_stats(char* buf, struct lru_cache* lc);
+extern size_t lc_printf_stats(struct seq_file *seq, struct lru_cache* lc);
 
 /* This can be used to stop lc_get from changing the set of active elements.
  * Note that the reference counts and order on the lru list may still change.

Modified: trunk/drbd.spec.in
===================================================================
--- trunk/drbd.spec.in	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/drbd.spec.in	2005-12-27 18:24:36 UTC (rev 2040)
@@ -110,7 +110,7 @@
 cat <<___ > etc/drbd.conf
 #
 # please have a a look at the example configuration file in
-# %{_docdir}/drbd.conf
+# %{_docdir}/%{name}/drbd.conf
 #
 ___
 
@@ -190,12 +190,51 @@
 /sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true
 
 %changelog
+
 * Tue Jul 26 2005 11:53:11 +0200 Lars Ellenberg <lars at linbit.com>
 - drbd (0.8_pre1-3)
   * remove all kernel 2.4.x compatibility crap
 
   FIXME mention all the great things we did so far
 
+* Thu Sep  1 2005 10:00:00 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.13-1)
+ * Fixed a SMP race condition that caused the resync process to stall
+   after a few seconds to minutes.
+ * The sync speed display is replaced by the word "stalled" in case the 
+   syncer makes no progress within 20 seconds.
+ * Some improvements to the documentation.
+
+* Wed Aug 24 2005 15:01:10 +0200 Philipp Reisner <phil at linbit.com>
+- drbd (0.7.12-1)
+ * The /proc/drbd code used a fixed single page buffer. This breaks 
+   at about 30 configured devices. Changed that to use the seq_file
+   interface.
+ * Bind the source of TCP connections to the IP address that is
+   mentioned in the configuration. 
+ * Fixed a connection flip-flop bug when the two peers used different
+   user provided sizes.
+ * Various fixes in the online-resize code path, including online shrinking
+   and handling the case that the memory allocation for the new bitmap
+   failed.
+ * Random improvements to drbdadm: 
+   * The "size" option is now allowed in the disk section
+   * A new "disable-ip-verification" option for the global section
+   * The "disable-io-hints" option is not longer available.
+   * Allow "drbdadm -- --size=XXX resize r0".
+ * Fixed a potential very unlikely race condition that in the end would
+   trigger an ERR in drbd_actlog.c:607. Actually I never saw this trigger.
+ * Fixed a logic bug in _drbd_process_ee() that, paired with a race condition
+   could trigger a "ASSERT(b->n_req == set_size)" upon disconnect.
+ * Removed the "disable_io_hints" module parameter.
+ * Added the "disable_bd_claim" module parameter, to allow users, WHO 
+   KNOW WHAT THEY DO, to read-access the data on the secondary node.
+ * Allow "drbdadm invalidate" only in StandAlone and Connected states. 
+ * DRBD no longer goes into StandAlone mode, if there is an random network 
+   error during the handshake phase, instead it retries the to connect.
+   Only critical problems, e.g. incompatible protocols will cause it 
+   to go into StandAlone mode.
+
 * Tue Jun  7 2005 19:13:00 +0200 Lars Ellenberg <lars at linbit.com>
 - drbd (0.7.11-1)
  * The upper limit of the runtime tuning parameter max_buffers 

Modified: trunk/scripts/drbd.conf
===================================================================
--- trunk/scripts/drbd.conf	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/scripts/drbd.conf	2005-12-27 18:24:36 UTC (rev 2040)
@@ -76,18 +76,8 @@
     #
     # dialog-refresh 5; # 5 seconds
 
-    # this is for people who set up a drbd device via the
-    # loopback network interface or between two VMs on the same
-    # box, for testing/simulating/presentation
-    # otherwise it could trigger a run_tasq_queue deadlock.
-    # I'm not sure whether this deadlock can happen with two
-    # nodes, but it seems at least extremely unlikely; and since
-    # the io_hints boost performance, keep them enabled.
-    #
-    # With linux 2.6 it no longer makes sense.
-    # So this option should vanish.	--lge
-    #
-    # disable-io-hints;
+    # You might disable one of drbdadm's sanity check.
+    # disable-ip-verification;
 # }
 
 
@@ -184,6 +174,11 @@
     # BTW, becoming primary on a disconnected node may also trigger the
     # execution of the outdate-peer handler.
     # split-brain-fix;
+
+    # In case you only want to use a fraction of the available space
+    # you might use the "size" option here.
+    #
+    # size 10G;
   }
 
   net {

Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c	2005-12-23 09:16:00 UTC (rev 2039)
+++ trunk/user/drbdadm_main.c	2005-12-27 18:24:36 UTC (rev 2040)
@@ -611,13 +611,16 @@
 {
   char* argv[20];
   struct d_option* opt;
-  int argc=0;
+  int i,argc=0;
 
   argv[argc++]=drbdsetup;
   argv[argc++]=res->me->device;
   argv[argc++]="resize";
   opt=find_opt(res->disk_options,"size");
   if(opt) ssprintf(argv[argc++],"--%s=%s",opt->name,opt->value);
+  for(i=0;i<soi;i++) {
+    argv[argc++]=setup_opts[i];
+  }
   argv[argc++]=0;
 
   return m_system(argv,SLEEPS_SHORT);



More information about the drbd-cvs mailing list