2e35d7583b
- Update for latest mdadm-4.1+ patches, this is required by jsc#SLE-10078 and jsc#SLE-9348. Mostly the purpose is for latest Intel IMSM raid support. The following patches also include previous patches with new re-ordered prefix numbers. - Makefile: install mdadm_env.sh to /usr/lib/mdadm (bsc#1111960) 0000-Makefile-install-mdadm_env.sh-to-usr-lib-mdadm.patch - Assemble: keep MD_DISK_FAILFAST and MD_DISK_WRITEMOSTLY flag (jsc#SLE-10078, jsc#SLE-9348) 0001-Assemble-keep-MD_DISK_FAILFAST-and-MD_DISK_WRITEMOST.patch - Document PART-POLICY lines (jsc#SLE-10078, jsc#SLE-9348) 0002-Document-PART-POLICY-lines.patc - policy: support devices with multiple paths. (jsc#SLE-10078, jsc#SLE-9348) 0003-policy-support-devices-with-multiple-paths.patch - mdcheck: add systemd unit files to run mdcheck. (bsc#1115407) 0004-mdcheck-add-systemd-unit-files-to-run-mdcheck.patch - Monitor: add system timer to run --oneshot periodically (bsc#1115407) 0005-Monitor-add-system-timer-to-run-oneshot-periodically.patch - imsm: update metadata correctly while raid10 double (jsc#SLE-10078, jsc#SLE-9348) 0006-imsm-update-metadata-correctly-while-raid10-double-d.patch - Assemble: mask FAILFAST and WRITEMOSTLY flags when finding (jsc#SLE-10078, jsc#SLE-9348) 0007-Assemble-mask-FAILFAST-and-WRITEMOSTLY-flags-when-fi.patch - Grow: avoid overflow in compute_backup_blocks() (jsc#SLE-10078, jsc#SLE-9348) 0008-Grow-avoid-overflow-in-compute_backup_blocks.patch - Grow: report correct new chunk size. (jsc#SLE-10078, jsc#SLE-9348) 0009-Grow-report-correct-new-chunk-size.patch OBS-URL: https://build.opensuse.org/request/show/781064 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=181
96 lines
3.3 KiB
Diff
96 lines
3.3 KiB
Diff
From 3364781b929f571a3dc3a6afed09eb1b03ce607c Mon Sep 17 00:00:00 2001
|
|
From: Blazej Kucman <blazej.kucman@intel.com>
|
|
Date: Wed, 19 Feb 2020 10:54:49 +0100
|
|
Subject: [PATCH] imsm: pass subarray id to kill_subarray function
|
|
Git-commit: 3364781b929f571a3dc3a6afed09eb1b03ce607c
|
|
Patch-mainline: mdadm-4.1+
|
|
References: jsc#SLE-10078, jsc#SLE-9348
|
|
|
|
After patch b6180160f ("imsm: save current_vol number")
|
|
current_vol for imsm is not set and kill_subarray()
|
|
cannot determine which volume has to be deleted.
|
|
Volume has to be passed as "subarray_id".
|
|
The parameter affects only IMSM metadata.
|
|
|
|
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
|
|
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
|
|
Signed-off-by: Coly Li <colyli@suse.de>
|
|
|
|
---
|
|
Kill.c | 2 +-
|
|
mdadm.h | 3 ++-
|
|
super-ddf.c | 2 +-
|
|
super-intel.c | 9 ++++-----
|
|
4 files changed, 8 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/Kill.c b/Kill.c
|
|
index d4767e2..bfd0efd 100644
|
|
--- a/Kill.c
|
|
+++ b/Kill.c
|
|
@@ -119,7 +119,7 @@ int Kill_subarray(char *dev, char *subarray, int verbose)
|
|
st->update_tail = &st->updates;
|
|
|
|
/* ok we've found our victim, drop the axe */
|
|
- rv = st->ss->kill_subarray(st);
|
|
+ rv = st->ss->kill_subarray(st, subarray);
|
|
if (rv) {
|
|
if (verbose >= 0)
|
|
pr_err("Failed to delete subarray-%s from %s\n",
|
|
diff --git a/mdadm.h b/mdadm.h
|
|
index 9e98778..d94569f 100644
|
|
--- a/mdadm.h
|
|
+++ b/mdadm.h
|
|
@@ -1038,7 +1038,8 @@ extern struct superswitch {
|
|
/* query the supertype for default geometry */
|
|
void (*default_geometry)(struct supertype *st, int *level, int *layout, int *chunk); /* optional */
|
|
/* Permit subarray's to be deleted from inactive containers */
|
|
- int (*kill_subarray)(struct supertype *st); /* optional */
|
|
+ int (*kill_subarray)(struct supertype *st,
|
|
+ char *subarray_id); /* optional */
|
|
/* Permit subarray's to be modified */
|
|
int (*update_subarray)(struct supertype *st, char *subarray,
|
|
char *update, struct mddev_ident *ident); /* optional */
|
|
diff --git a/super-ddf.c b/super-ddf.c
|
|
index 7802063..7cd5702 100644
|
|
--- a/super-ddf.c
|
|
+++ b/super-ddf.c
|
|
@@ -4446,7 +4446,7 @@ static int _kill_subarray_ddf(struct ddf_super *ddf, const char *guid)
|
|
return 0;
|
|
}
|
|
|
|
-static int kill_subarray_ddf(struct supertype *st)
|
|
+static int kill_subarray_ddf(struct supertype *st, char *subarray_id)
|
|
{
|
|
struct ddf_super *ddf = st->sb;
|
|
/*
|
|
diff --git a/super-intel.c b/super-intel.c
|
|
index 47809bc..e4d2122 100644
|
|
--- a/super-intel.c
|
|
+++ b/super-intel.c
|
|
@@ -7600,18 +7600,17 @@ static void default_geometry_imsm(struct supertype *st, int *level, int *layout,
|
|
|
|
static void handle_missing(struct intel_super *super, struct imsm_dev *dev);
|
|
|
|
-static int kill_subarray_imsm(struct supertype *st)
|
|
+static int kill_subarray_imsm(struct supertype *st, char *subarray_id)
|
|
{
|
|
- /* remove the subarray currently referenced by ->current_vol */
|
|
+ /* remove the subarray currently referenced by subarray_id */
|
|
__u8 i;
|
|
struct intel_dev **dp;
|
|
struct intel_super *super = st->sb;
|
|
- __u8 current_vol = super->current_vol;
|
|
+ __u8 current_vol = strtoul(subarray_id, NULL, 10);
|
|
struct imsm_super *mpb = super->anchor;
|
|
|
|
- if (super->current_vol < 0)
|
|
+ if (mpb->num_raid_devs == 0)
|
|
return 2;
|
|
- super->current_vol = -1; /* invalidate subarray cursor */
|
|
|
|
/* block deletions that would change the uuid of active subarrays
|
|
*
|
|
--
|
|
2.25.0
|
|
|