Accepting request 324252 from home:wanghaisu:branches:network:ha-clustering:Factory

Fate#317940. Support zeroout/discard instead of zap-devices.

OBS-URL: https://build.opensuse.org/request/show/324252
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=11
This commit is contained in:
nick wang 2015-08-19 09:34:17 +00:00 committed by Git OBS Bridge
parent 22880f54e2
commit 7b30832c23
5 changed files with 79 additions and 47 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Aug 19 09:00:49 UTC 2015 - nwang@suse.com
- Fate#317940. Support zeroout/discard instead of zap-devices
- Add patch zeroout-discard-devices.patch
- Remove zap-devices-xml.patch and zap-devices.patch
-------------------------------------------------------------------
Thu Jul 23 02:28:37 UTC 2015 - nwang@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package drbd-utils
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -28,8 +28,7 @@ Source: http://oss.linbit.com/drbd/%{name}-%{version}.tar.gz
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: init-script-fixes.diff
Patch2: fix-libdir-in-Makefile.patch
Patch3: zap-devices.patch
Patch4: zap-devices-xml.patch
Patch3: zeroout-discard-devices.patch
Provides: drbd-bash-completion = %{version}
Provides: drbd-pacemaker = %{version}
@ -74,7 +73,6 @@ raid 1. It is a building block for setting up clusters.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
./autogen.sh

View File

@ -1,19 +0,0 @@
diff -Naur drbd-utils-8.9.2.orig/documentation/v84/drbdsetup.xml drbd-utils-8.9.2/documentation/v84/drbdsetup.xml
--- drbd-utils-8.9.2.orig/documentation/v84/drbdsetup.xml 2015-07-20 16:06:52.950294231 +0800
+++ drbd-utils-8.9.2/documentation/v84/drbdsetup.xml 2015-07-20 17:56:21.106826315 +0800
@@ -1694,6 +1694,15 @@
<para>Clears the sync bitmap in addition to generating a new current UUID.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><option>--zap-devices</option></term>
+
+ <listitem>
+ <para>Start to zeroing out the device on both side in addition to generating
+ a new current UUID .</para>
+ </listitem>
+ </varlistentry>
</variablelist></para>
<para>This can be used to skip the initial sync, if you want to start from scratch. This

View File

@ -1,24 +0,0 @@
Index: drbd-utils-8.9.2/user/v84/config_flags.c
===================================================================
--- drbd-utils-8.9.2.orig/user/v84/config_flags.c
+++ drbd-utils-8.9.2/user/v84/config_flags.c
@@ -1019,6 +1019,7 @@ struct context_def new_current_uuid_cmd_
NLA_POLICY(new_c_uuid_parms),
.fields = {
{ "clear-bitmap", FLAG(clear_bm) },
+ { "zap-devices", FLAG(zap_devices) },
{ } },
};
Index: drbd-utils-8.9.2/user/v84/linux/drbd_genl.h
===================================================================
--- drbd-utils-8.9.2.orig/user/v84/linux/drbd_genl.h
+++ drbd-utils-8.9.2/user/v84/linux/drbd_genl.h
@@ -238,6 +238,7 @@ GENL_struct(DRBD_NLA_START_OV_PARMS, 9,
GENL_struct(DRBD_NLA_NEW_C_UUID_PARMS, 10, new_c_uuid_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, clear_bm)
+ __flg_field(2, DRBD_GENLA_F_MANDATORY, zap_devices)
)
GENL_struct(DRBD_NLA_TIMEOUT_PARMS, 11, timeout_parms,

View File

@ -0,0 +1,70 @@
From c80e2258d59d264d56bbea212ec98a114a1de32a Mon Sep 17 00:00:00 2001
From: Nick Wang <nwang@suse.com>
Date: Tue, 21 Jul 2015 10:32:41 +0800
Subject: [PATCH 1/1] drbdsetup: Support zeroout/discard devices instead of
initial full sync.
---
documentation/v84/drbdsetup.xml | 18 ++++++++++++++++++
user/v84/config_flags.c | 2 ++
user/v84/linux/drbd_genl.h | 2 ++
3 files changed, 22 insertions(+)
diff --git a/documentation/v84/drbdsetup.xml b/documentation/v84/drbdsetup.xml
index d4c4e87..039c6d8 100644
--- a/documentation/v84/drbdsetup.xml
+++ b/documentation/v84/drbdsetup.xml
@@ -1705,6 +1705,24 @@
<para>Clears the sync bitmap in addition to generating a new current UUID.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><option>--zeroout-devices</option></term>
+
+ <listitem>
+ <para>Start to zeroing out the device on both side in addition to generating
+ a new current UUID .</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--discard-devices</option></term>
+
+ <listitem>
+ <para>Start to allocate a thinly provided backing device on both side in
+ addition to generating a new current UUID .</para>
+ </listitem>
+ </varlistentry>
</variablelist></para>
<para>This can be used to skip the initial sync, if you want to start from scratch. This
diff --git a/user/v84/config_flags.c b/user/v84/config_flags.c
index 3b0303f..b9870fa 100644
--- a/user/v84/config_flags.c
+++ b/user/v84/config_flags.c
@@ -1019,6 +1019,8 @@ struct context_def new_current_uuid_cmd_ctx = {
NLA_POLICY(new_c_uuid_parms),
.fields = {
{ "clear-bitmap", FLAG(clear_bm) },
+ { "zeroout-devices", FLAG(zeroout_devices) },
+ { "discard-devices", FLAG(discard_devices) },
{ } },
};
diff --git a/user/v84/linux/drbd_genl.h b/user/v84/linux/drbd_genl.h
index 8ddedd1..2aabe4c 100644
--- a/user/v84/linux/drbd_genl.h
+++ b/user/v84/linux/drbd_genl.h
@@ -238,6 +238,8 @@ GENL_struct(DRBD_NLA_START_OV_PARMS, 9, start_ov_parms,
GENL_struct(DRBD_NLA_NEW_C_UUID_PARMS, 10, new_c_uuid_parms,
__flg_field(1, DRBD_GENLA_F_MANDATORY, clear_bm)
+ __flg_field(2, 0, zeroout_devices)
+ __flg_field(3, 0, discard_devices)
)
GENL_struct(DRBD_NLA_TIMEOUT_PARMS, 11, timeout_parms,
--
2.1.4