Hello community,

here is the log from the commit of package mdadm for openSUSE:Factory checked 
in at 2018-01-07 17:21:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mdadm (Old)
 and      /work/SRC/openSUSE:Factory/.mdadm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mdadm"

Sun Jan  7 17:21:13 2018 rev:112 rq:561488 version:4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/mdadm/mdadm.changes      2017-12-08 
12:54:42.311498638 +0100
+++ /work/SRC/openSUSE:Factory/.mdadm.new/mdadm.changes 2018-01-07 
17:21:17.009527746 +0100
@@ -1,0 +2,6 @@
+Wed Jan  3 14:44:06 UTC 2018 - [email protected]
+
+- 0207-managemon-Don-t-add-disk-to-the-array-after-it-has-s.patch
+  (bsc#1073862)
+
+-------------------------------------------------------------------

New:
----
  0207-managemon-Don-t-add-disk-to-the-array-after-it-has-s.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mdadm.spec ++++++
--- /var/tmp/diff_new_pack.cB3txt/_old  2018-01-07 17:21:19.545408882 +0100
+++ /var/tmp/diff_new_pack.cB3txt/_new  2018-01-07 17:21:19.545408882 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package mdadm
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -249,6 +249,7 @@
 Patch204:       0204-sysfs-include-faulty-drive-in-disk-count.patch
 Patch205:       0205-Monitor-msg-Don-t-print-error-message-if-mdmon-doesn.patch
 Patch206:       0206-imsm-continue-resync-on-3-disk-RAID10.patch
+Patch207:       0207-managemon-Don-t-add-disk-to-the-array-after-it-has-s.patch
 
 %define _udevdir %(pkg-config --variable=udevdir udev)
 %define _systemdshutdowndir %{_unitdir}/../system-shutdown
@@ -465,6 +466,7 @@
 %patch204 -p1
 %patch205 -p1
 %patch206 -p1
+%patch207 -p1
 
 %build
 make %{?_smp_mflags} CC="%__cc" CXFLAGS="$RPM_OPT_FLAGS -Wno-error" SUSE=yes

++++++ 0207-managemon-Don-t-add-disk-to-the-array-after-it-has-s.patch ++++++
>From a44c262abc49b3c69ee80c97813388e5d021d20b Mon Sep 17 00:00:00 2001
From: Tomasz Majchrzak <[email protected]>
Date: Thu, 7 Dec 2017 10:23:54 +0100
Subject: [PATCH] managemon: Don't add disk to the array after it has started
Git-commit: a44c262abc49b3c69ee80c97813388e5d021d20b
Patched-mainline: mdadm-4.0+
References: bsc#1073862

If disk has disappeared from the system and appears again, it is added to the
corresponding container as long the metadata matches and disk number is set.
This code had no effect on imsm until commit 20dc76d15b40 ("imsm: Set disk slot
number"). Now the disk is added to container but not to the array - it is
correct as the disk is out-of-sync. Rebuild should start for the disk but it
doesn't. There is the same behaviour for both imsm and ddf metadata.

There is no point to handle out-of-sync disk as "good member of array" so
remove that part of code. There are no scenarios when monitor is already
running and disk can be safely added to the array. Just write initial metadata
to the disk so it's taken for rebuild.

Signed-off-by: Tomasz Majchrzak <[email protected]>
Signed-off-by: Jes Sorensen <[email protected]>
Signed-off-by: Coly Li <[email protected]>
---
 managemon.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/managemon.c b/managemon.c
index 4e85398..101231c 100644
--- a/managemon.c
+++ b/managemon.c
@@ -266,9 +266,7 @@ static void add_disk_to_container(struct supertype *st, 
struct mdinfo *sd)
 {
        int dfd;
        char nm[20];
-       struct supertype *st2;
        struct metadata_update *update = NULL;
-       struct mdinfo info;
        mdu_disk_info_t dk = {
                .number = -1,
                .major = sd->disk.major,
@@ -287,25 +285,6 @@ static void add_disk_to_container(struct supertype *st, 
struct mdinfo *sd)
        if (dfd < 0)
                return;
 
-       /* Check the metadata and see if it is already part of this
-        * array
-        */
-       st2 = dup_super(st);
-       if (st2->ss->load_super(st2, dfd, NULL) == 0) {
-               st2->ss->getinfo_super(st2, &info, NULL);
-               if (st->ss->compare_super(st, st2) == 0 &&
-                   info.disk.raid_disk >= 0) {
-                       /* Looks like a good member of array.
-                        * Just accept it.
-                        * mdadm will incorporate any parts into
-                        * active arrays.
-                        */
-                       st2->ss->free_super(st2);
-                       return;
-               }
-       }
-       st2->ss->free_super(st2);
-
        st->update_tail = &update;
        st->ss->add_to_super(st, &dk, dfd, NULL, INVALID_SECTORS);
        st->ss->write_init_super(st);
-- 
2.15.1


Reply via email to