Hello community,

here is the log from the commit of package mdadm for openSUSE:Factory checked 
in at 2015-03-12 16:38:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mdadm (Old)
 and      /work/SRC/openSUSE:Factory/.mdadm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mdadm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mdadm/mdadm.changes      2015-02-06 
10:21:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.mdadm.new/mdadm.changes 2015-03-12 
16:38:24.000000000 +0100
@@ -1,0 +2,9 @@
+Mon Mar  2 20:33:12 UTC 2015 - mgo...@suse.com
+
+- 0001-IMSM-Add-warning-message-when-assemble-spanned-conta.patch
+  (bnc#882634)
+
+- 0001-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
+  (bnc#887773)
+
+-------------------------------------------------------------------

New:
----
  0001-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
  0001-IMSM-Add-warning-message-when-assemble-spanned-conta.patch

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

Other differences:
------------------
++++++ mdadm.spec ++++++
--- /var/tmp/diff_new_pack.Z4kfxD/_old  2015-03-12 16:38:25.000000000 +0100
+++ /var/tmp/diff_new_pack.Z4kfxD/_new  2015-03-12 16:38:25.000000000 +0100
@@ -46,6 +46,10 @@
 Patch3:         mdcheck-no-devices.fix
 # PATCH-FIX-UPSTREAM mdcheck-careful.patch bnc#910500 nfbr...@suse.de
 Patch4:         mdcheck-careful.patch
+# PATCH-FIX-UPSTREAM 
0001-IMSM-Add-warning-message-when-assemble-spanned-conta.patch bnc#882634 
nfbr...@suse.de
+Patch5:         0001-IMSM-Add-warning-message-when-assemble-spanned-conta.patch
+# PATCH-FIX-UPSTREAM 
0001-Grow-Do-not-try-to-restart-if-reshape-is-running.patch bnc#887773 
nfbr...@suse.de
+Patch6:         0001-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
 
 %define _udevdir %(pkg-config --variable=udevdir udev)
 %define _systemdshutdowndir %{_unitdir}/../system-shutdown
@@ -61,6 +65,8 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
 %build
 make %{?_smp_mflags} CC="%__cc" CXFLAGS="$RPM_OPT_FLAGS -Wno-error" SUSE=yes

++++++ 0001-Grow-Do-not-try-to-restart-if-reshape-is-running.patch ++++++
>From 13ffbe89b6103c146c08eb1c9a70833306c8322b Mon Sep 17 00:00:00 2001
From: Pawel Baldysiak <pawel.baldys...@intel.com>
Date: Wed, 16 Jul 2014 12:20:34 +0200
Subject: [PATCH] Grow: Do not try to restart if reshape is running

Grow process did not check if reshape is already started
when deciding about restarting.
Sync_action should be checked in this case, and if
reshape is running - restart flag should not be set.
Otherwise, Grow process will fail to write data to
sysfs, and reshape will not be continued.

Signed-off-by: Pawel Baldysiak <pawel.baldys...@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiew...@intel.com>
Signed-off-by: NeilBrown <ne...@suse.de>
---
 Grow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Grow.c b/Grow.c
index a2f4f1428787..ea9cc60e1f18 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char 
*devname,
        unsigned long long array_size;
        int done;
        struct mdinfo *sra = NULL;
+       char buf[20];
 
        /* when reshaping a RAID0, the component_size might be zero.
         * So try to fix that up.
@@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char 
*devname,
                goto release;
        }
 
-       if (st->ss->external && restart && (info->reshape_progress == 0)) {
+       if (st->ss->external && restart && (info->reshape_progress == 0) &&
+           !((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) 
&&
+             (strncmp(buf, "reshape", 7) == 0))) {
                /* When reshape is restarted from '0', very begin of array
                 * it is possible that for external metadata reshape and array
                 * configuration doesn't happen.
-- 
2.0.0

++++++ 0001-IMSM-Add-warning-message-when-assemble-spanned-conta.patch ++++++
>From 0c21b485e4beb7bcfe631412a231f7c1ea1067bc Mon Sep 17 00:00:00 2001
From: Pawel Baldysiak <pawel.baldys...@intel.com>
Date: Mon, 30 Jun 2014 12:22:22 +0000
Subject: [PATCH] IMSM: Add warning message when assemble spanned container

Due to several changes in code assemble with disks
spanned between different controllers can be obtained
in some cases. After IMSM container will be assembled, check HBA of
disks, and print proper warning if mismatch is detected.

Signed-off-by: Pawel Baldysiak <pawel.baldys...@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiew...@intel.com>
Signed-off-by: NeilBrown <ne...@suse.de>
---
 Assemble.c       |   16 ++++++++++++++++
 mdadm.h          |    3 +++
 platform-intel.h |    1 +
 super-intel.c    |   43 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+)

--- mdadm-3.3.1.orig/Assemble.c
+++ mdadm-3.3.1/Assemble.c
@@ -1001,6 +1001,22 @@ static int start_array(int mdfd,
                                        content->array.raid_disks);
                        fprintf(stderr, "\n");
                }
+
+               if (st->ss->validate_container) {
+                       struct mdinfo *devices_list;
+                       struct mdinfo *info_devices = xmalloc(sizeof(struct 
mdinfo)*(okcnt+sparecnt));
+                       unsigned int count;
+                       devices_list = NULL;
+                       for (count = 0; count < okcnt+sparecnt; count++) {
+                               info_devices[count] = devices[count].i;
+                               info_devices[count].next = devices_list;
+                               devices_list = &info_devices[count];
+                       }
+                       if (st->ss->validate_container(devices_list))
+                               pr_err("Mismatch detected!\n");
+                       free(info_devices);
+               }
+
                st->ss->free_super(st);
                sysfs_uevent(content, "change");
                if (err_ok && okcnt < (unsigned)content->array.raid_disks)
--- mdadm-3.3.1.orig/mdadm.h
+++ mdadm-3.3.1/mdadm.h
@@ -965,6 +965,9 @@ extern struct superswitch {
        /* for external backup area */
        int (*recover_backup)(struct supertype *st, struct mdinfo *info);
 
+       /* validate container after assemble */
+       int (*validate_container)(struct mdinfo *info);
+
        int swapuuid; /* true if uuid is bigending rather than hostendian */
        int external;
        const char *name; /* canonical metadata name */
--- mdadm-3.3.1.orig/platform-intel.h
+++ mdadm-3.3.1/platform-intel.h
@@ -204,6 +204,7 @@ struct sys_dev *find_intel_devices(void)
 const struct imsm_orom *find_imsm_capability(enum sys_dev_type hba_id);
 const struct imsm_orom *find_imsm_orom(void);
 int disk_attached_to_hba(int fd, const char *hba_path);
+int devt_attached_to_hba(dev_t dev, const char *hba_path);
 char *devt_to_devpath(dev_t dev);
 int path_attached_to_hba(const char *disk_path, const char *hba_path);
 const char *get_sys_dev_type(enum sys_dev_type);
--- mdadm-3.3.1.orig/super-intel.c
+++ mdadm-3.3.1/super-intel.c
@@ -10484,6 +10484,48 @@ abort:
 
        return ret_val;
 }
+
+/*******************************************************************************
+ * Function:   validate_container_imsm
+ * Description: This routine validates container after assemble,
+ *             eg. if devices in container are under the same controller.
+ *
+ * Parameters:
+ *     info    : linked list with info about devices used in array
+ * Returns:
+ *     1 : HBA mismatch
+ *     0 : Success
+ 
******************************************************************************/
+int validate_container_imsm(struct mdinfo *info)
+{
+       if (!check_env("IMSM_NO_PLATFORM")) {
+               struct sys_dev *idev;
+               struct mdinfo *dev;
+               char *hba_path = NULL;
+               char *dev_path = devt_to_devpath(makedev(info->disk.major,
+                                                                               
info->disk.minor));
+
+               for (idev = find_intel_devices(); idev; idev = idev->next) {
+                       if (strstr(dev_path, idev->path)) {
+                               hba_path = idev->path;
+                               break;
+                       }
+               }
+               free(dev_path);
+
+               if (hba_path) {
+                       for (dev = info->next; dev; dev = dev->next) {
+                               if 
(!devt_attached_to_hba(makedev(dev->disk.major,
+                                               dev->disk.minor), hba_path)) {
+                                       pr_err("WARNING - IMSM container 
assembled with disks under different HBAs!\n"
+                                               "       This operation is not 
supported and can lead to data loss.\n");
+                                       return 1;
+                               }
+                       }
+               }
+       }
+       return 0;
+}
 #endif /* MDASSEMBLE */
 
 struct superswitch super_imsm = {
@@ -10527,6 +10569,7 @@ struct superswitch super_imsm = {
        .free_super     = free_super_imsm,
        .match_metadata_desc = match_metadata_desc_imsm,
        .container_content = container_content_imsm,
+       .validate_container = validate_container_imsm,
 
        .external       = 1,
        .name = "imsm",
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to