[DRBD-cvs] svn commit by phil - r2042 - in trunk: . debian documentation drbd scripts user - The second half of the big SVNP run, merging all change

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Thu Dec 29 22:50:19 CET 2005


Author: phil
Date: 2005-12-29 22:50:17 +0100 (Thu, 29 Dec 2005)
New Revision: 2042

Removed:
   trunk/documentation/NFS-Server-README.txt
Modified:
   trunk/
   trunk/INSTALL
   trunk/README
   trunk/debian/drbd0.7-utils.docs
   trunk/documentation/drbd.conf.sgml
   trunk/documentation/drbd.sgml
   trunk/documentation/drbdadm.sgml
   trunk/documentation/drbddisk.sgml
   trunk/documentation/drbdsetup.sgml
   trunk/drbd.spec.in
   trunk/drbd/drbd_bitmap.c
   trunk/drbd/drbd_fs.c
   trunk/drbd/drbd_int.h
   trunk/drbd/drbd_main.c
   trunk/drbd/drbd_sizeof_sanity_check.c
   trunk/drbd/drbd_worker.c
   trunk/scripts/drbd.conf
   trunk/scripts/drbddisk
   trunk/scripts/patch-kernel
   trunk/user/drbdadm_adjust.c
   trunk/user/drbdadm_main.c
Log:
The second half of the big SVNP run, merging all changes in the
0.7 branch to the trunk



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

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/INSTALL	2005-12-29 21:50:17 UTC (rev 2042)
@@ -20,7 +20,7 @@
 	http://www.drbd.org
 	http://www.drbd.org/drbd-article.html
 	http://www.linux-mag.com/2003-11/toc.html
-	http://linuxha.trick.ca/DRBD , and of course,
+	http://www.linux-ha.org/DRBD , and of course,
 	http://www.drbd.org/support.html
 
 == Prerequisites ==
@@ -217,7 +217,7 @@
    Added on your feedback and request, if necessary... ;-)
 
    Also, have a look at http://www.drbd.org , the FAQ at
-   http://linuxha.trick.ca/DRBD , and the other links mentioned
+   http://www.linux-ha.org/DRBD , and the other links mentioned
    at the top of this page.
 
 == Building a .rpm of it ==

Modified: trunk/README
===================================================================
--- trunk/README	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/README	2005-12-29 21:50:17 UTC (rev 2042)
@@ -3,13 +3,17 @@
 				======
         		   by Philipp Reisner
 		   		   
-
 Reference documentation is included in the documentation directory.
 
+Please refer to the web pages at
+http://www.drbd.org/ and 
+http://www.linux-ha.org/DRBD
+http://www.linux-ha.org/DRBD/FAQ
+to find maintained information.
+
 Please have a look at INSTALL or INSTALL.html, too.
 BTW, if there is no INSTALL.html, say "make INSTALL.html" :)
 
-
 DEBUGING:
 ---------
 
@@ -25,15 +29,3 @@
 
 Read INSTALL.
 
- 
-GENERAL ISSUES
---------------
-
-Unfortunately our time does not allow us to
-maintain this README besides the software. 
-
-Please refer to the web pages at
-http://www.drbd.org/ and 
-http://linuxha.trick.ca/DRBD
-to find maintained information.
-

Modified: trunk/debian/drbd0.7-utils.docs
===================================================================
--- trunk/debian/drbd0.7-utils.docs	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/debian/drbd0.7-utils.docs	2005-12-29 21:50:17 UTC (rev 2042)
@@ -1,3 +1,2 @@
-documentation/NFS-Server-README.txt
 upgrade_0.6.x_to_0.7.0.txt
 upgrade_0.7.0_to_0.7.1.txt

Deleted: trunk/documentation/NFS-Server-README.txt
===================================================================
--- trunk/documentation/NFS-Server-README.txt	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/NFS-Server-README.txt	2005-12-29 21:50:17 UTC (rev 2042)
@@ -1,99 +0,0 @@
-
-NOTE:
-  with recent drbd (>= 0.7)
-  you typically NOT place any entries in /etc/fstab,
-  and the device names are /dev/drbdX instead of /dev/nbX
-
-This file should be replaced by a proper howto.
-someone vonlunteers to write one?
-
-see also the pages at linux-ha.org,
-  there should be more, and more recent,
-  info on this and related topics:
-  
-  http://linuxha.trick.ca/
-  http://www.linux-ha.org/
-
--- lge
-
-=========================================
-
-
-From: Erik de Wilde <E.deWilde at eijsink.nl>
-Subject: Re: [DRBD-dev] Bad performance when disks mounted with sync but data
-+corruption without sync
-To: Philipp Reisner <philipp.reisner at linbit.com>
-Cc: drbd-devel at lists.sourceforge.net
-From E.deWilde at eijsink.nl  Tue Feb 26 14:10:30 2002
-
-Hi,
-
-I did some testing, and I think I know what gave me the bad throughput
-
-I rebuild the filesystem on /dev/nb0 with reiserfs v3.6 in order not to
-have to use the sync option for mounting /dev/nbo
-on the server.  This didn't give me a good throughput, but it doubled
-from 64kB/sec to 128kB/sec, without data corruption on failover.
-
-I discovered I was using the sync option while mounting the filesystem
-on the workstation. I turned this off and guess what,
-througput now is about 2.5MB/sec, also without data-corruption during
-fail-over.
-
-I was wondering what would happen if I also turned off sync and
-no_wdelay on the server.
-Well, I tried and througput was 4.2MB/sec BUT I got DATA-CORRUPTION
-during failover.
-
-Conclusions:
-
-If using a non-journalling filesystem like ext2 one should mount
-/dev/nb0 with the sync option. (Why things where messed up for me using
-ext3 is still not clear to me). The sync option is not needed for
-journalling filesystems like reiserfs
-Example fstab entries (Just use one for each nbd device) for mounting
-/dev/nb0 on /drbd0:
-/dev/nb0        /drbd0  ext2             noauto,sync  0 0
-/dev/nb0        /drbd0  reiserfs        noauto          0 0
-
-Use the sync and no_wdelay option in your /etc/exports file on the
-server or else you will get data-corruption on fail-over
-Exampe exports entries:
-/drbd0/export         *(rw,no_root_squash,sync,no_wdelay)
-
-Do NOT USE THE SYNC OPTION while mounting the NFS filesystem on your
-client (workstation). When you do, things
-will slow down terribly
-
-Regards, Erik de Wilde
-
-
-From: Erik de Wilde <E.deWilde at eijsink.nl>
-Subject: [DRBD-dev] Stale NFS handles
-Date: Tue, 05 Mar 2002 16:27:34 +0100
- 
-Hello,
- 
-I read some messages about stale NFS handles and I thought some of you
-would be interested in this information.
-Until a few hours ago I got Stale NFS handles during fail-back
-operation, and it was reproducable.
-I first thought there was something wrong with DRBD's sync or that it
-had to do with heartbeat, but no, it
-was my nfsserver script that was causing them.
-In my nfsserver script there was the following line:
-/usr/sbin/exportfs -au
-This causes an unexport of all directories, which means that your server
-is really telling to its clients that it is going down, and this
-definitly is something YOU DO NOT WANT TO HAPPEN.
-Just execute the command on your server while copying big files to your
-server and look at the screen of your workstation.
- 
-So, if you don't want the Stale NFS handles to occur, just get rid of
-the line containing something like /usr/sbin/exportfs -au
-And, do not forget to do the same for the script in the /etc/rc.d (or
-/etc/init.d) directory or you will still get the same
-to happen when rebooting your fileserver (the one that is  actually
-exporting the filesystem at that moment)
- 
-Regards, Erik de Wilde

Modified: trunk/documentation/drbd.conf.sgml
===================================================================
--- trunk/documentation/drbd.conf.sgml	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/drbd.conf.sgml	2005-12-29 21:50:17 UTC (rev 2042)
@@ -59,6 +59,9 @@
  </para>
  <para>
  There may be multiple resource sections in a single drbd.conf file.
+ For more examples please have a look at the
+ <ulink url="http://www.linux-ha.org/DRBD/QuickStart07">
+ <citetitle>DRBD Quickstart Guide</citetitle></ulink>.
  </para>
 </refsect1>
 <refsect1>
@@ -527,7 +530,7 @@
 </refsect1>
 <refsect1>
 <title>Version</title>
-<simpara>This document is correct for version 0.7.13 of the DRBD distribution.
+<simpara>This document is correct for version 0.7.15 of the DRBD distribution.
 </simpara>
 </refsect1>
 <refsect1>
@@ -560,6 +563,8 @@
     <manvolnum>8</manvolnum></citerefentry>
     <citerefentry><refentrytitle>drbdadm</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry>
+    <ulink url="http://www.drbd.org/">
+    <citetitle>DRBD Homepage</citetitle></ulink>
 </para>
 </refsect1>
 </refentry>

Modified: trunk/documentation/drbd.sgml
===================================================================
--- trunk/documentation/drbd.sgml	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/drbd.sgml	2005-12-29 21:50:17 UTC (rev 2042)
@@ -53,7 +53,7 @@
 
 <refsect1>
   <title>Version</title>
-  <simpara>This document is correct for version 0.7.13 of the DRBD distribution.
+  <simpara>This document is correct for version 0.7.15 of the DRBD distribution.
   </simpara>
 </refsect1>
 
@@ -91,6 +91,8 @@
     <manvolnum>8</manvolnum></citerefentry>
     <citerefentry><refentrytitle>drbdadm</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry>
+    <ulink url="http://www.drbd.org/">
+    <citetitle>DRBD Homepage</citetitle></ulink>
   </para>
 </refsect1>
 

Modified: trunk/documentation/drbdadm.sgml
===================================================================
--- trunk/documentation/drbdadm.sgml	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/drbdadm.sgml	2005-12-29 21:50:17 UTC (rev 2042)
@@ -237,7 +237,7 @@
   <refsect1>
     <title>Version</title>
     <simpara>
-      This document is correct for version 0.7.13 of the DRBD distribution.
+      This document is correct for version 0.7.15 of the DRBD distribution.
     </simpara>
   </refsect1>
 
@@ -270,6 +270,8 @@
       <manvolnum>8</manvolnum></citerefentry>
       <citerefentry><refentrytitle>drbdsetup</refentrytitle>
       <manvolnum>8</manvolnum></citerefentry>
+      <ulink url="http://www.drbd.org/">
+      <citetitle>DRBD Homepage</citetitle></ulink>
     </para>
   </refsect1>
 </refentry>

Modified: trunk/documentation/drbddisk.sgml
===================================================================
--- trunk/documentation/drbddisk.sgml	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/drbddisk.sgml	2005-12-29 21:50:17 UTC (rev 2042)
@@ -45,7 +45,7 @@
 
 <refsect1>
 <title>Version</title>
-<simpara>This document is correct for version 0.7.13 of the DRBD distribution.
+<simpara>This document is correct for version 0.7.15 of the DRBD distribution.
 </simpara>
 </refsect1>
 
@@ -83,6 +83,8 @@
     <manvolnum>8</manvolnum></citerefentry>
     <citerefentry><refentrytitle>drbdadm</refentrytitle>
     <manvolnum>8</manvolnum></citerefentry>
+    <ulink url="http://www.drbd.org/">
+    <citetitle>DRBD Homepage</citetitle></ulink>
   </para>
 </refsect1>
 

Modified: trunk/documentation/drbdsetup.sgml
===================================================================
--- trunk/documentation/drbdsetup.sgml	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/documentation/drbdsetup.sgml	2005-12-29 21:50:17 UTC (rev 2042)
@@ -549,78 +549,16 @@
   </refsect1>
   <refsect1>
     <title>Examples</title>
-    <example>
-      <title>Setting up a device pair</title>
       <para>
-	In this example the hosts, <replaceable>tc1</replaceable> and
-	<replaceable>tc2</replaceable>, are connected by a crossover cable
-	via the interfaces <replaceable>192.168.37.2</replaceable> (on tc1)
-	and <replaceable>192.168.37.3</replaceable> (on tc2).  We want to
-	turn /dev/hda6 into a virtually shared disk.</para>
-      <para>On tc1 we need:</para>
-      <screen>
-	$ drbdsetup /dev/drbd0 disk /dev/hda6
-	$ drbdsetup /dev/drbd0 net 192.168.37.2 192.168.37.3 B
-      </screen>
-      <para>On tc2 we need:</para>
-      <screen>
-	$ drbdsetup /dev/drbd0 disk /dev/hda6
-	$ drbdsetup /dev/drbd0 net 192.168.37.3 192.168.37.2 B
-	$ drbdsetup /dev/drbd0 primary
-	$ cat /proc/drbd
-	<computeroutput>version: 0.7.0 (api:xx/proto:yy)
-
-	0: cs:Connected st:Primary/Secondary ns:0 nr:0 dw:0 dr:0 of:0
-	1: cs:WFConnection st:Secondary/Unknown ns:0 nr:0 dw:0 dr:0 of:0
-	</computeroutput>
-      </screen>
-      <para>From /proc/drbd we can see, that our device pair is connected, and
-      that the device is ready for use on tc2.</para>
-      <para>We can now run our application on top of it:</para>
-      <screen>
-	$ mkfs -b 4096 /dev/drbd0
-	$ mount /dev/drbd0 /mnt/mountpoint
-      </screen>
-    </example>
-    <example>
-      <title>Snapshot a device to a third machine</title>
-      <para>
-	In this example the hosts, <replaceable>tc1</replaceable> and
-	<replaceable>tc2</replaceable>, are connected and
-	<replaceable>tc2</replaceable> is primary on the /dev/drbd0 device.
-	The resource should be snapshotted to <replaceable>tc3's
-	/dev/hda6</replaceable>.</para>
-      <para>We need to prepare tc3:</para>
-      <screen>
-	$ drbdsetup /dev/drbd0 disk /dev/hda6
-	$ drbdsetup /dev/drbd0 net tc3 tc2 B
-      </screen>
-      <para>On tc2 we have to issue:</para>
-      <screen>
-	$ drbdsetup /dev/drbd0 disconnect
-	$ drbdsetup /dev/drbd0 net tc2 tc3 B --sync-rate 4M
-	$ #drbdsetup /dev/drbd0 replicate
-	$ drbdsetup /dev/drbd0 wait_sync
-	$ drbdsetup /dev/drbd0 disconnect
-	$ drbdsetup /dev/drbd0 net tc2 tc1 B
-	$ #drbdsetup /dev/drbd0 replicate
-      </screen>
-      <para>With release 0.6.x DRBD's meta-data management still can not detect changing
-      mirroring partners. Therefore you might have to issue
-      the replicate commands as outlined in the example.</para>
-      <para>Since the snapshot was taken without bringing the on disk file 
-      system into a consistent state we need these commands on tc3:</para>
-      <screen>
-	$ drbdsetup /dev/drbd0 down
-	$ fsck /dev/hda6
-	$ mount /dev/hda6 /some/mountpoint
-      </screen>
-    </example>
+      For examples please have a look at the
+      <ulink url="http://www.linux-ha.org/DRBD/QuickStart07">
+      <citetitle>DRBD Quickstart Guide</citetitle></ulink>.
+      </para>
   </refsect1>
 
   <refsect1>
     <title>Version</title>
-    <simpara>This document is correct for version 0.7.13 of the DRBD distribution.
+    <simpara>This document is correct for version 0.7.15 of the DRBD distribution.
     </simpara>
   </refsect1>
 
@@ -653,6 +591,8 @@
       <manvolnum>8</manvolnum></citerefentry>
       <citerefentry><refentrytitle>drbdadm</refentrytitle>
       <manvolnum>8</manvolnum></citerefentry>
+      <ulink url="http://www.drbd.org/">
+      <citetitle>DRBD Homepage</citetitle></ulink>
     </para>
   </refsect1>
 </refentry>

Modified: trunk/drbd/drbd_bitmap.c
===================================================================
--- trunk/drbd/drbd_bitmap.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_bitmap.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -841,11 +841,12 @@
 int drbd_bm_clear_bit(drbd_dev *mdev, const unsigned long bitnr)
 {
 	struct drbd_bitmap *b = mdev->bitmap;
+	unsigned long flags;
 	int i;
 	ERR_IF(!b) return 0;
 	ERR_IF(!b->bm) return 0;
 
-	spin_lock_irq(&b->bm_lock);
+	spin_lock_irqsave(&b->bm_lock,flags);
 	BM_PARANOIA_CHECK();
 	MUST_NOT_BE_LOCKED();
 	ERR_IF (bitnr >= b->bm_bits) {
@@ -855,7 +856,7 @@
 		i = (0 != __test_and_clear_bit(bitnr, b->bm));
 		b->bm_set -= i;
 	}
-	spin_unlock_irq(&b->bm_lock);
+	spin_unlock_irqrestore(&b->bm_lock,flags);
 
 	/* clearing bits should only take place when sync is in progress!
 	 * this is only called from drbd_set_in_sync.

Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_fs.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -236,6 +236,7 @@
 	} else {
 		if (t) lc_free(t);
 	}
+	drbd_md_write(mdev);
 	return 0;
 }
 
@@ -1085,6 +1086,16 @@
 	return 0;
 }
 
+#ifdef CONFIG_COMPAT
+long drbd_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg)
+{
+	int ret;
+	// lock_kernel(); Not needed, since we have mdev->device_mutex
+	ret = drbd_ioctl(f->f_dentry->d_inode, f, cmd, arg);
+	// unlock_kernel();
+	return ret;
+}
+#endif
 
 int drbd_ioctl(struct inode *inode, struct file *file,
 			   unsigned int cmd, unsigned long arg)
@@ -1376,4 +1387,3 @@
  out_unlocked:
 	return err;
 }
-

Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_int.h	2005-12-29 21:50:17 UTC (rev 2042)
@@ -25,7 +25,6 @@
   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
-
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <linux/version.h>
@@ -1071,6 +1070,7 @@
 extern int drbd_ioctl(struct inode *inode, struct file *file,
 		      unsigned int cmd, unsigned long arg);
 drbd_disks_t drbd_try_outdate_peer(drbd_dev *mdev);
+extern long drbd_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg);
 
 // drbd_worker.c
 enum RSPauseReason {
@@ -1140,8 +1140,11 @@
  * inline helper functions
  *************************/
 
+<<<<<<< .working
 #include "drbd_compat_wrappers.h"
 
+=======
+>>>>>>> .merge-right.r2000
 #define peer_mask role_mask
 #define pdsk_mask disk_mask
 

Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_main.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -66,7 +66,15 @@
 #define LANANA_DRBD_MAJOR 147
 
 #ifdef CONFIG_COMPAT
-# include <linux/ioctl32.h>
+# if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10)
+    /* FIXME on which thing could we test instead of the KERNEL_VERSION
+     * again?  register_ioctl32_conversion was deprecated in 2.6.10, got
+     * "officially" deprecated somewhen in 2.6.12, and removed in 2.6.14.
+     * so lets assume all vendor kernels did the transition.  */
+#   define HAVE_COMPAT_IOCTL_MEMBER
+# else
+#  include <linux/ioctl32.h>
+# endif
 #endif
 
 struct after_state_chg_work {
@@ -149,7 +157,10 @@
 	.owner =   THIS_MODULE,
 	.open =    drbd_open,
 	.release = drbd_close,
-	.ioctl =   drbd_ioctl
+	.ioctl =   drbd_ioctl,
+#ifdef HAVE_COMPAT_IOCTL_MEMBER
+	.compat_ioctl = drbd_compat_ioctl,
+#endif
 };
 
 #define ARRY_SIZE(A) (sizeof(A)/sizeof(A[0]))
@@ -2290,6 +2301,7 @@
 	register_ioctl32_conversion(DRBD_IOCTL_UNCONFIG_DISK,NULL);
 	unlock_kernel();
 #endif
+#endif
 
 	printk(KERN_INFO DEVICE_NAME ": initialised. "
 	       "Version: " REL_VERSION " (api:%d/proto:%d)\n",

Modified: trunk/drbd/drbd_sizeof_sanity_check.c
===================================================================
--- trunk/drbd/drbd_sizeof_sanity_check.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_sizeof_sanity_check.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -1,10 +1,6 @@
 #include <linux/drbd.h>
-#include <linux/linkage.h>
+#include <linux/kernel.h>
 
-/* from linux/kernel.h */
-asmlinkage int printk(const char * fmt, ...)
-	__attribute__ ((format (printf, 1, 2)));
-
 #define SZO(type,size) \
 	s = sizeof(type); \
 	if (s != size) { \

Modified: trunk/drbd/drbd_worker.c
===================================================================
--- trunk/drbd/drbd_worker.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd/drbd_worker.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -234,6 +234,10 @@
 
 	// FIXME: what if partner was SyncTarget, and is out of sync for
 	// this area ?? ... should be handled in the receiver.
+
+	ok = drbd_io_error(mdev);
+	if(unlikely(!ok)) ERR("Sending in w_read_retry_remote() failed\n");
+	
 	inc_ap_pending(mdev);
 	ok = drbd_read_remote(mdev,req);
 	if(unlikely(!ok)) {

Modified: trunk/drbd.spec.in
===================================================================
--- trunk/drbd.spec.in	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/drbd.spec.in	2005-12-29 21:50:17 UTC (rev 2042)
@@ -130,9 +130,9 @@
 %{_mandir}/man8/drbd.8.gz
 %{_mandir}/man8/drbdsetup.8.gz
 %{_mandir}/man8/drbdadm.8.gz
+%{_mandir}/man8/drbddisk.8.gz
 %{_mandir}/man5/drbd.conf.5.gz
 %doc scripts/drbd.conf
-%doc documentation/NFS-Server-README.txt
 %doc COPYING
 %doc README
 %doc file.list

Modified: trunk/scripts/drbd.conf
===================================================================
--- trunk/scripts/drbd.conf	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/scripts/drbd.conf	2005-12-29 21:50:17 UTC (rev 2042)
@@ -7,7 +7,13 @@
 # you ought to know about the protocol, and the various timeouts.
 #
 # you probably want to set the rate in the syncer sections
+
 #
+# NOTE common pitfall:
+# rate is given in units of _byte_ not bit
+#
+
+#
 # increase timeout and maybe ping-int in net{}, if you see
 # problems with "connection lost/connection established"
 # (or change your setup to reduce network latency; make sure full
@@ -194,8 +200,8 @@
     # ping-int      10;    # 10 seconds  (unit = 1 second)
 
     # Maximal number of requests (4K) to be allocated by DRBD.
-    # The minimum is hardcoded to 32 (=128 kb).
-    # For hight performance installations it might help if you
+    # The minimum is hardcoded to 32 (=128 kByte).
+    # 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.
     #
@@ -286,8 +292,16 @@
 
   syncer {
     # Limit the bandwith used by the resynchronisation process.
-    # default unit is KB/sec; optional suffixes K,M,G are allowed
+    # default unit is kByte/sec; optional suffixes K,M,G are allowed.
     #
+    # Even though this is a network setting, the units are based
+    # on _byte_ (octet for our french friends) not bit.
+    # We are storage guys.
+    #
+    # Note that on 100Mbit ethernet, you cannot expect more than
+    # 12.5 MByte total transfer rate.
+    # Consider using GigaBit Ethernet.
+    #
     rate 10M;
 
     # Normally all devices are resynchronized parallel. 

Modified: trunk/scripts/drbddisk
===================================================================
--- trunk/scripts/drbddisk	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/scripts/drbddisk	2005-12-29 21:50:17 UTC (rev 2042)
@@ -23,9 +23,9 @@
 
 case "$CMD" in
     start)
-    	# try several times, in case heartbeat deadtime
+	# try several times, in case heartbeat deadtime
 	# was smaller than drbd ping time
-    	try=6
+	try=6
 	while true; do
 		$DRBDADM primary $RES && break
 		let "--try" || exit 20
@@ -33,21 +33,23 @@
 	done
 	;;
     stop)
-    	# exec, so the exit code of drbdadm propagates
+	# exec, so the exit code of drbdadm propagates
 	exec $DRBDADM secondary $RES
 	;;
     status)
 	if [ "$RES" = "all" ]; then
 	    echo "A resource name is required for status inquiries."
 	    exit 10
-        fi
-	ST=$( $DRBDADM state $RES 2> /dev/null )
-	ST=${ST%/*}
-	if [ "$ST" = "Primary" ]; then
+	fi
+	ST=$( $DRBDADM state $RES 2>&1 )
+	STATE=${ST%/*}
+	if [ "$STATE" = "Primary" ]; then
 	    echo "running"
+	elif [ "$STATE" = "Secondary" ]; then
+	    echo "stopped"
 	else
-	    echo "stopped"
-        fi
+	    echo "$ST"
+	fi
 	;;
     *)
 	echo "Usage: drbddisk [resource] {start|stop|status}"

Modified: trunk/scripts/patch-kernel
===================================================================
--- trunk/scripts/patch-kernel	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/scripts/patch-kernel	2005-12-29 21:50:17 UTC (rev 2042)
@@ -118,6 +118,7 @@
 
 # Bring over the current kernel Kconfig and Makefile
 for f in drivers/block/{Kconfig,Makefile} arch/um/Kconfig_block ; do
+	test -e $KERNEL/$f || continue
 	cp -a $KERNEL/$f $KERNEL_BASE/$f
 	cp -a $KERNEL/$f $DRBD_BASE/$f
 done
@@ -138,6 +139,7 @@
 #	}'
 }
 for f in drivers/block/Kconfig arch/um/Kconfig_block ; do
+	test -e $KERNEL_BASE/$f || continue
 	grep drbd/ $DRBD_BASE/$f >/dev/null && continue
 	patch_Kconfig < $KERNEL_BASE/$f > $DRBD_BASE/$f
 done

Modified: trunk/user/drbdadm_adjust.c
===================================================================
--- trunk/user/drbdadm_adjust.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/user/drbdadm_adjust.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -62,7 +62,7 @@
     close(pipes[0]); // close reading end
     dup2(pipes[1],1); // 1 = stdout
     close(pipes[1]);
-    execv(argv[0],argv);
+    execvp(argv[0],argv);
     fprintf(stderr,"Can not exec");
     exit(E_exec_error);
   }

Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c	2005-12-27 18:33:25 UTC (rev 2041)
+++ trunk/user/drbdadm_main.c	2005-12-29 21:50:17 UTC (rev 2042)
@@ -458,6 +458,11 @@
 {
   char **path;
 
+  if (drbdsetup) {
+    free(drbdsetup);
+    drbdsetup = NULL;
+  }
+
   path=pathes;
   while(*path) {
     if(access(*path,X_OK)==0) {
@@ -504,7 +509,7 @@
   }
   if(pid == 0) {
     if(flags & SUPRESS_STDERR) fclose(stderr);
-    execv(argv[0],argv);
+    execvp(argv[0],argv);
     fprintf(stderr,"Can not exec\n");
     exit(E_exec_error);
   }
@@ -1296,7 +1301,6 @@
   struct d_resource *res,*tmp;
   char *env_drbd_nodename = NULL;
 
-  drbdsetup=NULL;
   drbdmeta=NULL;
   dry_run=0;
   yyin=NULL;
@@ -1305,18 +1309,36 @@
   env_drbd_nodename = getenv("__DRBD_NODE__");
   if (env_drbd_nodename && *env_drbd_nodename) {
     strncpy(nodeinfo.nodename,env_drbd_nodename,sizeof(nodeinfo.nodename)-1);
-    nodeinfo.nodename[sizeof(nodeinfo.nodename)] = 0;
+    nodeinfo.nodename[sizeof(nodeinfo.nodename)-1] = 0;
     fprintf(stderr, "\n"
             "   found __DRBD_NODE__ in environment\n"
             "   PRETENDING that I am >>%s<<\n\n",nodeinfo.nodename);
   }
 
-  if( (progname=strrchr(argv[0],'/')) )
-    argv[0] = ++progname;
-  else
-    progname=argv[0];
   if(argc == 1) print_usage_and_exit("missing arguments"); // arguments missing.
 
+  /* in case drbdadm is called with an absolut or relative pathname
+   * look for the drbdsetup binary in the same location,
+   * otherwise, just let execvp sort it out... */
+  if( (progname=strrchr(argv[0],'/')) == 0 ) {
+    progname=argv[0];
+    drbdsetup = strdup("drbdsetup");
+  } else {
+    size_t len = strlen(argv[0]) + 1;
+    ++progname;
+    len += strlen("drbdsetup") - strlen(progname);
+    drbdsetup = malloc(len);
+    if (drbdsetup) {
+      strncpy(drbdsetup, argv[0], (progname - argv[0]));
+      strcpy(drbdsetup + (progname - argv[0]), "drbdsetup");
+    }
+    argv[0] = progname;
+  }
+  if (drbdsetup == NULL) {
+    fprintf(stderr,"could not strdup argv[0].\n");
+    exit(E_exec_error);
+  }
+
   opterr=1;
   optind=0;
   while(1)



More information about the drbd-cvs mailing list