[DRBD-cvs] r1609 - in branches/drbd-0.7: documentation scripts user

svn at svn.drbd.org svn at svn.drbd.org
Thu Oct 21 01:50:59 CEST 2004


Author: lars
Date: 2004-10-21 01:50:56 +0200 (Thu, 21 Oct 2004)
New Revision: 1609

Modified:
   branches/drbd-0.7/documentation/drbd.conf.sgml
   branches/drbd-0.7/scripts/drbd.conf
   branches/drbd-0.7/user/drbdadm_parser.y
Log:
added range_check to drbdadm_parser.y,
 now helmut can add rangechecks where neccessary

Modified: branches/drbd-0.7/documentation/drbd.conf.sgml
===================================================================
--- branches/drbd-0.7/documentation/drbd.conf.sgml	2004-10-20 13:28:36 UTC (rev 1608)
+++ branches/drbd-0.7/documentation/drbd.conf.sgml	2004-10-20 23:50:56 UTC (rev 1609)
@@ -37,14 +37,16 @@
     device    /dev/drbd1;
     disk      /dev/hda7;
     address   10.1.1.31:7789;
+    meta-disk  internal;
   }
 
   on thost2 {
     device    /dev/drbd1;
     disk      /dev/hda7;
     address   10.1.1.32:7789;
+    meta-disk  internal;
   }
-}	
+}
 </programlisting>
 </example>
  In this example there is a single DRBD resource (called drbd0) which uses
@@ -524,7 +526,7 @@
 </refsect1>
 <refsect1>
 <title>Version</title>
-<simpara>This document is correct for version 0.7-pre7 of the DRBD distribution.
+<simpara>This document is correct for version 0.7.5 of the DRBD distribution.
 </simpara>
 </refsect1>
 <refsect1>

Modified: branches/drbd-0.7/scripts/drbd.conf
===================================================================
--- branches/drbd-0.7/scripts/drbd.conf	2004-10-20 13:28:36 UTC (rev 1608)
+++ branches/drbd-0.7/scripts/drbd.conf	2004-10-20 23:50:56 UTC (rev 1609)
@@ -125,8 +125,10 @@
   startup {
     # Wait for connection timeout. 
     # The init script blocks the boot process until the resources
-    # are connected. 
+    # are connected. This is so when the cluster manager starts later,
+    # it does not see a resource with internal split-brain.
     # In case you want to limit the wait time, do it here.
+    # Default is 0, which means unlimited. Unit is seconds.
     #
     # wfc-timeout  0;
 

Modified: branches/drbd-0.7/user/drbdadm_parser.y
===================================================================
--- branches/drbd-0.7/user/drbdadm_parser.y	2004-10-20 13:28:36 UTC (rev 1608)
+++ branches/drbd-0.7/user/drbdadm_parser.y	2004-10-20 23:50:56 UTC (rev 1609)
@@ -100,6 +100,16 @@
   }
 }
 
+void range_check(int i, char *what, int rmin, int rmax)
+{
+  if (rmin > i || i > rmax) {
+    fprintf(stderr,
+	    "%s:%d: value of %s (%d) out of range [%d..%d].\n",
+	    config_file, fline, what, i, rmin, rmax);
+    exit(E_config_invalid);
+  }
+}
+
 #define CHKU(what,val) \
 	c_host->what = val; \
 	check_uniq( #what, "%s:%s",c_hostname,val)
@@ -149,9 +159,15 @@
 glob_stmt:	  TK_DISABLE_IO_HINTS
 			{ global_options.disable_io_hints=1;   }
 		| TK_MINOR_COUNT TK_INTEGER
-			{ global_options.minor_count=atoi($2); }
-		| TK_DIALOG_REFRESH TK_INTEGER   
-                        { global_options.dialog_refresh=atoi($2); }
+		{
+			global_options.minor_count=atoi($2);
+			range_check(global_options.minor_count,"minor_count",1,255);
+		}
+		| TK_DIALOG_REFRESH TK_INTEGER
+                {
+			global_options.dialog_refresh=atoi($2);
+			range_check(global_options.dialog_refresh,"dialog_refresh",0,600);
+		}
 		;
 
 resources:	  /* empty */	     { $$ = 0; }



More information about the drbd-cvs mailing list