|
|
2910d5 |
From b771faef931c798a4553db0a8c1366aff90079c6 Mon Sep 17 00:00:00 2001
|
|
|
2910d5 |
From: Blazej Kucman <blazej.kucman@intel.com>
|
|
|
2910d5 |
Date: Fri, 29 Nov 2019 15:21:08 +0100
|
|
|
2910d5 |
Subject: [RHEL8.2 PATCH 52/61] imsm: return correct uuid for volume in detail
|
|
|
2910d5 |
|
|
|
2910d5 |
Fixes the side effect of the patch b6180160f ("imsm: save current_vol number")
|
|
|
2910d5 |
- wrong UUID is printed in detail for each volume.
|
|
|
2910d5 |
New parameter "subarray" is added to determine what info should be extracted
|
|
|
2910d5 |
from metadata (subarray or container).
|
|
|
2910d5 |
The parameter affects only IMSM metadata.
|
|
|
2910d5 |
|
|
|
2910d5 |
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
|
|
|
2910d5 |
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
|
|
|
2910d5 |
---
|
|
|
2910d5 |
Detail.c | 4 ++--
|
|
|
2910d5 |
mdadm.h | 5 +++--
|
|
|
2910d5 |
super-ddf.c | 5 +++--
|
|
|
2910d5 |
super-intel.c | 20 ++++++++++++++++++--
|
|
|
2910d5 |
super0.c | 4 ++--
|
|
|
2910d5 |
super1.c | 4 ++--
|
|
|
2910d5 |
6 files changed, 30 insertions(+), 12 deletions(-)
|
|
|
2910d5 |
|
|
|
2910d5 |
diff --git a/Detail.c b/Detail.c
|
|
|
2910d5 |
index 3e61e37..24fa462 100644
|
|
|
2910d5 |
--- a/Detail.c
|
|
|
2910d5 |
+++ b/Detail.c
|
|
|
2910d5 |
@@ -623,7 +623,7 @@ This is pretty boring
|
|
|
2910d5 |
free_mdstat(ms);
|
|
|
2910d5 |
|
|
|
2910d5 |
if (st && st->sb)
|
|
|
2910d5 |
- st->ss->detail_super(st, c->homehost);
|
|
|
2910d5 |
+ st->ss->detail_super(st, c->homehost, subarray);
|
|
|
2910d5 |
|
|
|
2910d5 |
if (array.raid_disks == 0 && sra &&
|
|
|
2910d5 |
sra->array.major_version == -1 &&
|
|
|
2910d5 |
@@ -767,7 +767,7 @@ skip_devices_state:
|
|
|
2910d5 |
if (spares && c->brief && array.raid_disks)
|
|
|
2910d5 |
printf(" spares=%d", spares);
|
|
|
2910d5 |
if (c->brief && st && st->sb)
|
|
|
2910d5 |
- st->ss->brief_detail_super(st);
|
|
|
2910d5 |
+ st->ss->brief_detail_super(st, subarray);
|
|
|
2910d5 |
if (st)
|
|
|
2910d5 |
st->ss->free_super(st);
|
|
|
2910d5 |
|
|
|
2910d5 |
diff --git a/mdadm.h b/mdadm.h
|
|
|
2910d5 |
index c88ceab..91f1338 100644
|
|
|
2910d5 |
--- a/mdadm.h
|
|
|
2910d5 |
+++ b/mdadm.h
|
|
|
2910d5 |
@@ -847,8 +847,9 @@ extern struct superswitch {
|
|
|
2910d5 |
/* Used to report details of an active array.
|
|
|
2910d5 |
* ->load_super was possibly given a 'component' string.
|
|
|
2910d5 |
*/
|
|
|
2910d5 |
- void (*detail_super)(struct supertype *st, char *homehost);
|
|
|
2910d5 |
- void (*brief_detail_super)(struct supertype *st);
|
|
|
2910d5 |
+ void (*detail_super)(struct supertype *st, char *homehost,
|
|
|
2910d5 |
+ char *subarray);
|
|
|
2910d5 |
+ void (*brief_detail_super)(struct supertype *st, char *subarray);
|
|
|
2910d5 |
void (*export_detail_super)(struct supertype *st);
|
|
|
2910d5 |
|
|
|
2910d5 |
/* Optional: platform hardware / firmware details */
|
|
|
2910d5 |
diff --git a/super-ddf.c b/super-ddf.c
|
|
|
2910d5 |
index c095e8a..7802063 100644
|
|
|
2910d5 |
--- a/super-ddf.c
|
|
|
2910d5 |
+++ b/super-ddf.c
|
|
|
2910d5 |
@@ -1730,7 +1730,8 @@ err:
|
|
|
2910d5 |
return 1;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void detail_super_ddf(struct supertype *st, char *homehost)
|
|
|
2910d5 |
+static void detail_super_ddf(struct supertype *st, char *homehost,
|
|
|
2910d5 |
+ char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct ddf_super *sb = st->sb;
|
|
|
2910d5 |
int cnt = be16_to_cpu(sb->virt->populated_vdes);
|
|
|
2910d5 |
@@ -1787,7 +1788,7 @@ static void uuid_of_ddf_subarray(const struct ddf_super *ddf,
|
|
|
2910d5 |
memcpy(uuid, sha, 4*4);
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void brief_detail_super_ddf(struct supertype *st)
|
|
|
2910d5 |
+static void brief_detail_super_ddf(struct supertype *st, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct mdinfo info;
|
|
|
2910d5 |
char nbuf[64];
|
|
|
2910d5 |
diff --git a/super-intel.c b/super-intel.c
|
|
|
2910d5 |
index a7fbed4..86dcb69 100644
|
|
|
2910d5 |
--- a/super-intel.c
|
|
|
2910d5 |
+++ b/super-intel.c
|
|
|
2910d5 |
@@ -2183,23 +2183,39 @@ err:
|
|
|
2910d5 |
return 1;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void detail_super_imsm(struct supertype *st, char *homehost)
|
|
|
2910d5 |
+static void detail_super_imsm(struct supertype *st, char *homehost,
|
|
|
2910d5 |
+ char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct mdinfo info;
|
|
|
2910d5 |
char nbuf[64];
|
|
|
2910d5 |
+ struct intel_super *super = st->sb;
|
|
|
2910d5 |
+ int temp_vol = super->current_vol;
|
|
|
2910d5 |
+
|
|
|
2910d5 |
+ if (subarray)
|
|
|
2910d5 |
+ super->current_vol = strtoul(subarray, NULL, 10);
|
|
|
2910d5 |
|
|
|
2910d5 |
getinfo_super_imsm(st, &info, NULL);
|
|
|
2910d5 |
fname_from_uuid(st, &info, nbuf, ':');
|
|
|
2910d5 |
printf("\n UUID : %s\n", nbuf + 5);
|
|
|
2910d5 |
+
|
|
|
2910d5 |
+ super->current_vol = temp_vol;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void brief_detail_super_imsm(struct supertype *st)
|
|
|
2910d5 |
+static void brief_detail_super_imsm(struct supertype *st, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct mdinfo info;
|
|
|
2910d5 |
char nbuf[64];
|
|
|
2910d5 |
+ struct intel_super *super = st->sb;
|
|
|
2910d5 |
+ int temp_vol = super->current_vol;
|
|
|
2910d5 |
+
|
|
|
2910d5 |
+ if (subarray)
|
|
|
2910d5 |
+ super->current_vol = strtoul(subarray, NULL, 10);
|
|
|
2910d5 |
+
|
|
|
2910d5 |
getinfo_super_imsm(st, &info, NULL);
|
|
|
2910d5 |
fname_from_uuid(st, &info, nbuf, ':');
|
|
|
2910d5 |
printf(" UUID=%s", nbuf + 5);
|
|
|
2910d5 |
+
|
|
|
2910d5 |
+ super->current_vol = temp_vol;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
static int imsm_read_serial(int fd, char *devname, __u8 *serial);
|
|
|
2910d5 |
diff --git a/super0.c b/super0.c
|
|
|
2910d5 |
index 42989b9..6b7c0e3 100644
|
|
|
2910d5 |
--- a/super0.c
|
|
|
2910d5 |
+++ b/super0.c
|
|
|
2910d5 |
@@ -348,7 +348,7 @@ err:
|
|
|
2910d5 |
return 1;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void detail_super0(struct supertype *st, char *homehost)
|
|
|
2910d5 |
+static void detail_super0(struct supertype *st, char *homehost, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
mdp_super_t *sb = st->sb;
|
|
|
2910d5 |
printf(" UUID : ");
|
|
|
2910d5 |
@@ -368,7 +368,7 @@ static void detail_super0(struct supertype *st, char *homehost)
|
|
|
2910d5 |
printf("\n Events : %d.%d\n\n", sb->events_hi, sb->events_lo);
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void brief_detail_super0(struct supertype *st)
|
|
|
2910d5 |
+static void brief_detail_super0(struct supertype *st, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
mdp_super_t *sb = st->sb;
|
|
|
2910d5 |
printf(" UUID=");
|
|
|
2910d5 |
diff --git a/super1.c b/super1.c
|
|
|
2910d5 |
index b85dc20..929466d 100644
|
|
|
2910d5 |
--- a/super1.c
|
|
|
2910d5 |
+++ b/super1.c
|
|
|
2910d5 |
@@ -833,7 +833,7 @@ err:
|
|
|
2910d5 |
return 1;
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void detail_super1(struct supertype *st, char *homehost)
|
|
|
2910d5 |
+static void detail_super1(struct supertype *st, char *homehost, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct mdp_superblock_1 *sb = st->sb;
|
|
|
2910d5 |
bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE);
|
|
|
2910d5 |
@@ -857,7 +857,7 @@ static void detail_super1(struct supertype *st, char *homehost)
|
|
|
2910d5 |
(unsigned long long)__le64_to_cpu(sb->events));
|
|
|
2910d5 |
}
|
|
|
2910d5 |
|
|
|
2910d5 |
-static void brief_detail_super1(struct supertype *st)
|
|
|
2910d5 |
+static void brief_detail_super1(struct supertype *st, char *subarray)
|
|
|
2910d5 |
{
|
|
|
2910d5 |
struct mdp_superblock_1 *sb = st->sb;
|
|
|
2910d5 |
int i;
|
|
|
2910d5 |
--
|
|
|
2910d5 |
2.7.5
|
|
|
2910d5 |
|