]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Kill: remove duplicate tests on 'force'.
authorNeilBrown <neilb@suse.de>
Tue, 1 Nov 2011 02:30:44 +0000 (13:30 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 1 Nov 2011 02:30:44 +0000 (13:30 +1100)
We test 'force' twice with the second having not chance of
taking effect.
As a result a subsequent message - intended for use in the 'force'
case is never generated.

So remove the first test - it is unnecessary.

Reported-by: Jes.Sorensen@redhat.com
Signed-off-by: NeilBrown <neilb@suse.de>
Kill.c

diff --git a/Kill.c b/Kill.c
index b841a5b73ca48b5f27881c63458017a37c511d66..bac48440bb626a98fc6e7231aaadecd49e0945dc 100644 (file)
--- a/Kill.c
+++ b/Kill.c
@@ -61,9 +61,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
        }
        st->ignore_hw_compat = 1;
        rv = st->ss->load_super(st, fd, dev);
-       if (force && rv >= 2)
-               rv = 0; /* ignore bad data in superblock */
-       if (rv== 0 || (force && rv >= 2)) {
+       if (rv == 0 || (force && rv >= 2)) {
                st->ss->free_super(st);
                st->ss->init_super(st, NULL, 0, "", NULL, NULL);
                if (st->ss->store_super(st, fd)) {