[DRBD-cvs] svn commit by phil - r2145 - in trunk: documentation
drbd scripts user - * renamed --do-what-I-say to
--overwrite-data-of-peer
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Thu Apr 13 18:01:02 CEST 2006
*
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: phil
Date: 2006-04-13 18:01:00 +0200 (Thu, 13 Apr 2006)
New Revision: 2145
Modified:
trunk/documentation/drbdsetup.sgml
trunk/drbd/drbd_bitmap.c
trunk/scripts/drbd
trunk/user/drbdadm_main.c
trunk/user/drbdsetup.c
Log:
* renamed --do-what-I-say to --overwrite-data-of-peer
* made sure that config errors or the register as usage.drbd.org
dialog are displayed when drbd is stared via the /etc/init.d/drbd
script.
* ko_count was not initialized in drbdsetup. fixed that.
Modified: trunk/documentation/drbdsetup.sgml
===================================================================
--- trunk/documentation/drbdsetup.sgml 2006-04-11 16:18:17 UTC (rev 2144)
+++ trunk/documentation/drbdsetup.sgml 2006-04-13 16:01:00 UTC (rev 2145)
@@ -79,7 +79,7 @@
<command>drbdsetup</command>
<arg choice="req"><replaceable>device</replaceable></arg>
<arg choice="req">primary</arg>
- <arg>-d</arg>
+ <arg>-o</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>drbdsetup</command>
@@ -628,8 +628,8 @@
</para>
<variablelist>
<varlistentry>
- <term><option>-d</option>,
- <option>--do-what-I-say</option></term>
+ <term><option>-o</option>,
+ <option>--overwrite-data-of-peer</option></term>
<listitem>
<para>
Becoming primary fails if the local replica is
Modified: trunk/drbd/drbd_bitmap.c
===================================================================
--- trunk/drbd/drbd_bitmap.c 2006-04-11 16:18:17 UTC (rev 2144)
+++ trunk/drbd/drbd_bitmap.c 2006-04-13 16:01:00 UTC (rev 2145)
@@ -366,7 +366,6 @@
goto free_obm;
} else {
bits = BM_SECT_TO_BIT(ALIGN(capacity,BM_SECTORS_PER_BIT));
- DUMPI(bits);
/* if we would use
words = ALIGN(bits,BITS_PER_LONG) >> LN2_BPL;
Modified: trunk/scripts/drbd
===================================================================
--- trunk/scripts/drbd 2006-04-11 16:18:17 UTC (rev 2144)
+++ trunk/scripts/drbd 2006-04-13 16:01:00 UTC (rev 2145)
@@ -81,6 +81,12 @@
IFS=$IFS_O
}
+# Just in case drbdadm want to display any errors in the configuration
+# file, or we need to ask the user about registering this installation
+# at http://usage.drbd.org, we call drbdadm here without any IO
+# redirection.
+$DRBDADM sh-nop
+
case "$1" in
start)
echo -n "Starting DRBD resources: "
Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c 2006-04-11 16:18:17 UTC (rev 2144)
+++ trunk/user/drbdadm_main.c 2006-04-13 16:01:00 UTC (rev 2145)
@@ -91,6 +91,7 @@
static int adm_dump(struct d_resource* ,const char* );
static int adm_wait_c(struct d_resource* ,const char* );
static int adm_wait_ci(struct d_resource* ,const char* );
+static int sh_nop(struct d_resource* ,const char* );
static int sh_resources(struct d_resource* ,const char* );
static int sh_mod_parms(struct d_resource* ,const char* );
static int sh_dev(struct d_resource* ,const char* );
@@ -205,6 +206,7 @@
{ "dump-md", admm_generic, 1,1,0 },
{ "wait_con_int", adm_wait_ci, 1,0,1 },
{ "hidden-commands", hidden_cmds, 1,0,0 },
+ { "sh-nop", sh_nop, 2,0,0 },
{ "sh-resources", sh_resources, 2,0,0 },
{ "sh-mod-parms", sh_mod_parms, 2,0,0 },
{ "sh-dev", sh_dev, 2,1,0 },
@@ -323,6 +325,12 @@
return 0;
}
+static int sh_nop(struct d_resource* ignored __attribute((unused)),
+ const char* unused __attribute((unused)))
+{
+ return 0;
+}
+
static int sh_resources(struct d_resource* ignored __attribute((unused)),const char* unused __attribute((unused)))
{
struct d_resource *res,*t;
Modified: trunk/user/drbdsetup.c
===================================================================
--- trunk/user/drbdsetup.c 2006-04-11 16:18:17 UTC (rev 2144)
+++ trunk/user/drbdsetup.c 2006-04-13 16:01:00 UTC (rev 2145)
@@ -134,6 +134,7 @@
{"primary", cmd_primary, 0,
(struct option[]) {
{ "do-what-I-say",no_argument, 0, 'd' },
+ { "overwrite-data-of-peer",no_argument, 0, 'o' },
{ 0, 0, 0, 0 } } },
{"secondary", cmd_secondary, 0, 0, },
{"wait_sync", cmd_wait_sync, 0,
@@ -529,6 +530,7 @@
cn->config.after_sb_1p = DEF_AFTER_SB_1P;
cn->config.after_sb_2p = DEF_AFTER_SB_2P;
cn->config.want_lose = 0;
+ cn->config.ko_count = DEF_KO_COUNT;
if(argc==0) return 0;
@@ -838,14 +840,22 @@
if(c == -1) break;
switch(c)
{
- case 'd':
- if (strcmp("--do-what-I-say",argv[optind-1])) {
- fprintf(stderr,"%s\nYou have to spell out --do-what-I-say, if you mean it\n",
+ case 'o':
+ if (strcmp("--overwrite-data-of-peer",argv[optind-1])) {
+ fprintf(stderr,"%s\nYou have to spell out --overwrite-data-of-peer, if you mean it\n",
argv[optind-1]);
return 20;
}
newstate |= DontBlameDrbd;
break;
+ case 'd':
+ fprintf(stderr,
+"--do-what-I-say was renamed to --overwrite-data-of-peer, since that is\n"
+"less ambiguous.\n"
+"Only do it if you really know what you are doing. DRBD is going to save\n"
+"this fact to its metadata, and it will really overwrite the peer's copy\n"
+"of data with the local copy.\n");
+ return 20;
case 1: // non option argument. see getopt_long(3)
fprintf(stderr,"%s: Unexpected nonoption argument '%s'\n",cmdname,optarg);
case '?':
More information about the drbd-cvs
mailing list