Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1937715d2ccdd461…
Commit: 1937715d2ccdd46122da862c6d7c1ef0ed7d1230
Parent: 8a8e59fb5afd1f85be5cb96744b3eb34ad9a5e71
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Jan 8 15:23:30 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Jan 8 15:24:43 2014 +0100
test: Add a regression test for pvcreate -ff.
---
test/shell/pvcreate-ff.sh | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/test/shell/pvcreate-ff.sh b/test/shell/pvcreate-ff.sh
new file mode 100644
index 0000000..38284af
--- /dev/null
+++ b/test/shell/pvcreate-ff.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux prepare_devs 2
+pvcreate $dev1
+vgcreate foo $dev1
+pvcreate -ff -y $dev1
+vgs
+vgcreate foo $dev1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=de3abfa6222c7c35…
Commit: de3abfa6222c7c35f8262032112fea3b6098fd58
Parent: 0a13815e68c3d85b140f8c6d4d91592ae2f8b992
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 8 10:56:05 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 8 10:56:05 2014 +0100
thin: cleanup _thin_pool_add_message
Make this code a bit more readable for Coverity as otherwise
it marks the "type" variable in the "_thin_pool_add_message" fn
as undefined for certain path (...which is normally unreachable anyway,
but let's clean this up).
---
lib/thin/thin.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index df6482e..ff263d9 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -62,16 +62,10 @@ static int _thin_pool_add_message(struct lv_segment *seg,
lv_name);
/* FIXME: switch to _SNAP later, if the created LV has an origin */
type = DM_THIN_MESSAGE_CREATE_THIN;
- }
-
- if (!dm_config_get_uint32(sn, "delete", &delete_id)) {
- if (!lv)
- return SEG_LOG_ERROR("Unknown message in");
- } else {
- if (lv)
- return SEG_LOG_ERROR("Unsupported message format in");
+ } else if (dm_config_get_uint32(sn, "delete", &delete_id))
type = DM_THIN_MESSAGE_DELETE;
- }
+ else
+ return SEG_LOG_ERROR("Unknown message in");
if (!attach_pool_message(seg, type, lv, delete_id, 1))
return_0;