import mdadm-4.2-7.el8

c8s imports/c8s/mdadm-4.2-7.el8
CentOS Sources 8 months ago committed by Stepan Oksanichenko
parent e1d08abce6
commit f0d40589eb

@ -1,7 +1,7 @@
From f1cc8ab9ab6a92c3cd94ab7590b46285e214681e Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Tue, 15 Mar 2022 09:30:30 +0100
Subject: [PATCH 01/12] Unify error message.
Subject: [PATCH 01/83] Unify error message.
Provide the same error message for the same error that can occur in Grow.c and super-intel.c.
@ -43,5 +43,5 @@ index d5fad102..5ffa7636 100644
}
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 5ce5a15f0bf007e850e15259bba4f53736605fb2 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 25 Mar 2022 12:48:59 +0100
Subject: [PATCH 02/12] mdadm: Fix double free
Subject: [PATCH 02/83] mdadm: Fix double free
If there was a size mismatch after creation it would get fixed on grow
in imsm_fix_size_mismatch(), but due to double free "double free or corruption (fasttop)"
@ -29,5 +29,5 @@ index 5ffa7636..6ff336ee 100644
ret_val = 0;
exit:
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From fea026b4849182fc8413014c81456e7215af28d9 Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Wed, 23 Mar 2022 15:05:19 +0100
Subject: [PATCH 03/12] Grow_reshape: Add r0 grow size error message and update
Subject: [PATCH 03/83] Grow_reshape: Add r0 grow size error message and update
man
Grow size on r0 is not supported for imsm and native metadata.
@ -79,5 +79,5 @@ index be902dba..e2a42425 100644
.BR \-Z ", " \-\-array\-size=
This is only meaningful with
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From cf9a109209aad285372b67306d54118af6fc522b Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Fri, 14 Jan 2022 16:44:33 +0100
Subject: [PATCH 04/12] udev: adapt rules to systemd v247
Subject: [PATCH 04/83] udev: adapt rules to systemd v247
New events have been added in kernel 4.14 ("bind" and "unbind").
Systemd maintainer suggests to modify "add|change" branches.
@ -63,5 +63,5 @@ index 12bdcaa8..2e185cee 100644
ENV{MD_LEVEL}=="raid[1-9]*", \
TEST=="/sys/block/$parent/device/timeout", \
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 83a379cfbd283b387919fe05d44eb4c49e155ad6 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Mon, 21 Feb 2022 13:05:20 +0100
Subject: [PATCH 05/12] Replace error prone signal() with sigaction()
Subject: [PATCH 05/83] Replace error prone signal() with sigaction()
Up to this date signal() was used which implementation could vary [1].
Sigaction() call is preferred. This commit introduces replacement
@ -248,5 +248,5 @@ index 3d05d074..cc94f96e 100644
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From e9dd5644843e2013a7dd1a8a5da2b9fa35837416 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 18 Mar 2022 09:26:04 +0100
Subject: [PATCH 06/12] mdadm: Respect config file location in man
Subject: [PATCH 06/83] mdadm: Respect config file location in man
Default config file location could differ depending on OS (e.g. Debian family).
This patch takes default config file into consideration when creating mdadm.man
@ -1529,5 +1529,5 @@ index 00000000..83edd008
+.BR mdadm (8),
+.BR md (4).
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From c23400377bb3d8e98e810cd92dba478dac1dff82 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 18 Mar 2022 09:26:05 +0100
Subject: [PATCH 07/12] mdadm: Update ReadMe
Subject: [PATCH 07/83] mdadm: Update ReadMe
Instead of hardcoded config file path give reference to config manual.
@ -44,5 +44,5 @@ index 81399765..8f873c48 100644
;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 24e075c659d0a8718aabefe5af4c97195a188af7 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 18 Mar 2022 09:26:06 +0100
Subject: [PATCH 08/12] mdadm: Update config man regarding default files and
Subject: [PATCH 08/83] mdadm: Update config man regarding default files and
multi-keyword behavior
Simplify default and alternative config file and directory location references
@ -199,5 +199,5 @@ index 83edd008..dd331a6a 100644
.SH EXAMPLE
DEVICE /dev/sd[bcdjkl]1
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From c33bbda5b0e127bb161fd4ad44bcfaa2a5daf153 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 18 Mar 2022 09:26:07 +0100
Subject: [PATCH 09/12] mdadm: Update config manual
Subject: [PATCH 09/83] mdadm: Update config manual
Add missing HOMECLUSTER keyword description.
@ -41,5 +41,5 @@ index dd331a6a..cd4e6a9d 100644
.B AUTO
A list of names of metadata format can be given, each preceded by a
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 913f07d1db4a0078acc26d6ccabe1c315cf9273c Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Thu, 20 Jan 2022 13:18:32 +0100
Subject: [PATCH 10/12] Create, Build: use default_layout()
Subject: [PATCH 10/83] Create, Build: use default_layout()
This code is duplicated for Build mode so make default_layout() extern
and use it. Simplify the function structure.
@ -149,5 +149,5 @@ index 26e7e5cd..cd72e711 100644
extern int parse_layout_10(char *layout);
extern int parse_layout_faulty(char *layout);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 5f21d67472ad08c1e96b4385254adba79aa1c467 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Thu, 20 Jan 2022 13:18:33 +0100
Subject: [PATCH 11/12] mdadm: add map_num_s()
Subject: [PATCH 11/83] mdadm: add map_num_s()
map_num() returns NULL if key is not defined. This patch adds
alternative, non NULL version for cases where NULL is not expected.
@ -378,5 +378,5 @@ index 2995713d..0d98a65f 100644
info->consistency_policy = CONSISTENCY_POLICY_RESYNC;
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 1066ab83dbe9a4cc20f7db44a40aa2cbb9d5eed6 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 13 May 2022 09:19:42 +0200
Subject: [PATCH 13/52] mdmon: Stop parsing duplicate options
Subject: [PATCH 13/83] mdmon: Stop parsing duplicate options
Introduce new function is_duplicate_opt() to check if given option
was already used and prevent setting it again along with an error
@ -118,5 +118,5 @@ index 5570574b..c057da63 100644
struct mdstat_ent *mdstat, *e;
int container_len = strlen(container_name);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 20e114e334ed6ed3280c37a9a08fb95578393d1a Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Thu, 19 May 2022 09:16:08 +0200
Subject: [PATCH 14/52] Grow: block -n on external volumes.
Subject: [PATCH 14/83] Grow: block -n on external volumes.
Performing --raid-devices on external metadata volume should be blocked
as it causes unwanted behaviour.
@ -37,5 +37,5 @@ index 8a242b0f..f6efbc48 100644
return 1;
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From de064c93e3819d72720e4fba6575265ba10e1553 Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Mon, 13 Jun 2022 12:11:25 +0200
Subject: [PATCH 15/52] Incremental: Fix possible memory and resource leaks
Subject: [PATCH 15/83] Incremental: Fix possible memory and resource leaks
map allocated through map_by_uuid() is not freed if mdfd is invalid.
In addition mdfd is not closed, and mdinfo list is not freed too.
@ -86,5 +86,5 @@ index a57fc323..4d0cd9d6 100644
static void run_udisks(char *arg1, char *arg2)
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From e702f392959d1c2ad2089e595b52235ed97b4e18 Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Mon, 6 Jun 2022 12:32:12 +0200
Subject: [PATCH 16/52] Mdmonitor: Fix segfault
Subject: [PATCH 16/83] Mdmonitor: Fix segfault
Mdadm with "--monitor" parameter requires md device
as an argument to be monitored. If given argument is
@ -94,5 +94,5 @@ index 245be537..d18c9319 100644
{
static char devnm[32];
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From f5ff2988761625b43eb15555993f2797af29f166 Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Mon, 6 Jun 2022 12:32:13 +0200
Subject: [PATCH 17/52] Mdmonitor: Improve logging method
Subject: [PATCH 17/83] Mdmonitor: Improve logging method
Change logging, and as a result, mdmonitor in verbose
mode will report its configuration.
@ -57,5 +57,5 @@ index 4e5802b5..6ca1ebe5 100644
info.mailaddr = mailaddr;
info.mailfrom = mailfrom;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 626bc45396c4959f2c4685c2faa7c4f553f4efdf Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Mon, 13 Jun 2022 11:59:34 +0200
Subject: [PATCH 18/52] Fix possible NULL ptr dereferences and memory leaks
Subject: [PATCH 18/83] Fix possible NULL ptr dereferences and memory leaks
In Assemble there was a NULL check for sra variable,
which effectively didn't stop the execution in every case.
@ -69,5 +69,5 @@ index 8cda23a7..abbc8b09 100644
}
vc->phys_refnum[i_prim] = ddf->phys->entries[dl->pdnum].refnum;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 756a15f32338fdf0c562678694bc8991ad6afb90 Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Mon, 13 Jun 2022 12:00:09 +0200
Subject: [PATCH 19/52] imsm: Remove possibility for get_imsm_dev to return
Subject: [PATCH 19/83] imsm: Remove possibility for get_imsm_dev to return
NULL
Returning NULL from get_imsm_dev or __get_imsm_dev will cause segfault.
@ -297,5 +297,5 @@ index ba3bd41f..3788feb9 100644
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 190dc029b141c423e724566cbed5d5afbb10b05a Mon Sep 17 00:00:00 2001
From: Nigel Croxon <ncroxon@redhat.com>
Date: Mon, 18 Apr 2022 13:44:23 -0400
Subject: [PATCH 20/52] Revert "mdadm: fix coredump of mdadm --monitor -r"
Subject: [PATCH 20/83] Revert "mdadm: fix coredump of mdadm --monitor -r"
This reverts commit 546047688e1c64638f462147c755b58119cabdc8.
@ -81,5 +81,5 @@ index 8f873c48..bec1be9a 100644
struct option long_options[] = {
{"manage", 0, 0, ManageOpt},
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 953cc7e5a485a91ddec7312c7a5d7779749fad5f Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Tue, 21 Jun 2022 00:10:39 +0800
Subject: [PATCH 21/52] util: replace ioctl use with function
Subject: [PATCH 21/83] util: replace ioctl use with function
Replace using of ioctl calling to get md array info with
special function prepared to it.
@ -27,5 +27,5 @@ index cc94f96e..38f0420e 100644
return !ret;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 63902857b98c37c8ac4b837bb01d006b327a4532 Mon Sep 17 00:00:00 2001
From: Heming Zhao <heming.zhao@suse.com>
Date: Tue, 21 Jun 2022 00:10:40 +0800
Subject: [PATCH 22/52] mdadm/super1: restore commit 45a87c2f31335 to fix
Subject: [PATCH 22/83] mdadm/super1: restore commit 45a87c2f31335 to fix
clustered slot issue
Commit 9d67f6496c71 ("mdadm:check the nodes when operate clustered
@ -106,5 +106,5 @@ index e3e2f954..3a0c69fd 100644
* Since the nodes num is not increased, no
* need to check the space enough or not,
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 76c152ca9851e9fcdf52e8f6e7e6c09b936bdd14 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 21 Jun 2022 00:10:41 +0800
Subject: [PATCH 23/52] imsm: introduce get_disk_slot_in_dev()
Subject: [PATCH 23/83] imsm: introduce get_disk_slot_in_dev()
The routine was added to remove unnecessary get_imsm_dev() and
get_imsm_map() calls, used only to determine disk slot.
@ -118,5 +118,5 @@ index 3788feb9..cd1f1e3d 100644
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 6d4d9ab295de165e57b5c30e044028dbffb8f297 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 21 Jun 2022 00:10:42 +0800
Subject: [PATCH 24/52] imsm: use same slot across container
Subject: [PATCH 24/83] imsm: use same slot across container
Autolayout relies on drives order on super->disks list, but
it is not quaranted by readdir() in sysfs_read(). As a result
@ -248,5 +248,5 @@ index cd1f1e3d..deef7c87 100644
*/
max_size = 0;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 9a7df595bbe360132cb37c8b39aa1fd9ac24b43f Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 21 Jun 2022 00:10:43 +0800
Subject: [PATCH 25/52] imsm: block changing slots during creation
Subject: [PATCH 25/83] imsm: block changing slots during creation
If user specifies drives for array creation, then slot order across
volumes is not preserved.
@ -118,5 +118,5 @@ index ff5d2093..00000000
-offset=$((offset+size+4096))
-imsm_check member $member4 $num_disks $level $size 1024 $offset
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 70f1ff4291b0388adca1f4c91918ce1175e8b360 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Wed, 15 Jun 2022 14:28:39 +0200
Subject: [PATCH 26/52] mdadm: block update=ppl for non raid456 levels
Subject: [PATCH 26/83] mdadm: block update=ppl for non raid456 levels
Option ppl should be used only for raid levels 4, 5 and 6. Cancel update
for other levels.
@ -173,5 +173,5 @@ index 3a0c69fd..71af860c 100644
__le64_to_cpu(sb->reshape_position);
reshape_chunk = __le32_to_cpu(sb->new_chunk);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 42e02e613fb0b4a2c0c0d984b9e6e2933875bb44 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 22 Jul 2022 08:43:47 +0200
Subject: [PATCH 27/52] mdadm: Fix array size mismatch after grow
Subject: [PATCH 27/83] mdadm: Fix array size mismatch after grow
imsm_fix_size_mismatch() is invoked to fix the problem, but it couldn't
proceed due to migration check. This patch allows for intended behavior.
@ -26,5 +26,5 @@ index 8ffe485c..76b947f5 100644
/* There is a difference, confirm that imsm_dev_size is
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 751757620afb25a4c02746bf8368a7b5f22352ec Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Fri, 22 Jul 2022 08:43:48 +0200
Subject: [PATCH 28/52] mdadm: Remove dead code in imsm_fix_size_mismatch
Subject: [PATCH 28/83] mdadm: Remove dead code in imsm_fix_size_mismatch
imsm_create_metadata_update_for_size_change() that returns u_size value
could return 0 in the past. As its behavior changed, and returned value
@ -30,5 +30,5 @@ index 76b947f5..4ddfcf94 100644
if (st->update_tail) {
append_metadata_update(st, update, u_size);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From c8d1c398505b62d9129a4e711f17e4469f4327ff Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Thu, 14 Jul 2022 09:02:10 +0200
Subject: [PATCH 29/52] Monitor: use devname as char array instead of pointer
Subject: [PATCH 29/83] Monitor: use devname as char array instead of pointer
Device name wasn't filled properly due to incorrect use of strcpy.
Strcpy was used twice. Firstly to fill devname with "/dev/md/"
@ -36,5 +36,5 @@ index 6ca1ebe5..a5b11ae2 100644
if (!is_mddev(mdlist->devname))
return 1;
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 84d969be8f6d8a345b75f558fad26e4f62a558f6 Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Thu, 14 Jul 2022 09:02:11 +0200
Subject: [PATCH 30/52] Monitor: use snprintf to fill device name
Subject: [PATCH 30/83] Monitor: use snprintf to fill device name
Safe string functions are propagated in Monitor.c.
@ -129,5 +129,5 @@ index a5b11ae2..93f36ac0 100644
*sl = 0;
} else
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 14ae4c37bce9a53da08d59d6c2d7e0946e9c9f47 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:06 -0600
Subject: [PATCH 31/52] Makefile: Don't build static build with everything and
Subject: [PATCH 31/83] Makefile: Don't build static build with everything and
everything-test
Running the test suite requires building everything, but it seems to be
@ -38,5 +38,5 @@ index bf126033..ec1f99ed 100644
# mdadm.uclibc doesn't work on x86-64
# mdadm.tcc doesn't work..
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 679bd9508a30b2a0a1baecc9a21dd6c7d8d8d7dc Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:07 -0600
Subject: [PATCH 32/52] DDF: Cleanup validate_geometry_ddf_container()
Subject: [PATCH 32/83] DDF: Cleanup validate_geometry_ddf_container()
Move the function up so that the function declaration is not necessary
and remove the unused arguments to the function.
@ -137,5 +137,5 @@ index abbc8b09..9d867f69 100644
int level, int layout, int raiddisks,
int *chunk, unsigned long long size,
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 2b93288a5650bb811932836f67f30d63c5ddcfbd Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:08 -0600
Subject: [PATCH 33/52] DDF: Fix NULL pointer dereference in
Subject: [PATCH 33/83] DDF: Fix NULL pointer dereference in
validate_geometry_ddf()
A relatively recent patch added a call to validate_geometry() in
@ -45,5 +45,5 @@ index 9d867f69..949e7d15 100644
mdu_array_info_t array = {
.level = level,
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 548e9b916f86c06e2cdb50d8f49633f9bec66c7e Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:09 -0600
Subject: [PATCH 34/52] mdadm/Grow: Fix use after close bug by closing after
Subject: [PATCH 34/83] mdadm/Grow: Fix use after close bug by closing after
fork
The test 07reshape-grow fails most of the time. But it succeeds around
@ -81,5 +81,5 @@ index 8c520d42..97f22c75 100644
* reshape will wait for them. This would mean that
* the first section that we suspend will stay suspended
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 9ae62977b51dab0f4bb46b1c8ea5ebd1705b2f4d Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:10 -0600
Subject: [PATCH 35/52] monitor: Avoid segfault when calling NULL
Subject: [PATCH 35/83] monitor: Avoid segfault when calling NULL
get_bad_blocks
Not all struct superswitch implement a get_bad_blocks() function,
@ -32,5 +32,5 @@ index b877e595..820a93d0 100644
* Get a list of bad blocks for an array, then read list of
* acknowledged bad blocks from kernel and compare it against metadata
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 6c9d9260633f2c8491985b0782cf0fbd7e51651b Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:11 -0600
Subject: [PATCH 36/52] mdadm: Fix mdadm -r remove option regression
Subject: [PATCH 36/83] mdadm: Fix mdadm -r remove option regression
The commit noted below globally adds a parameter to the -r option but missed
the fact that -r is used for another purpose: --remove.
@ -74,5 +74,5 @@ index 974415b9..163f4a49 100644
extern char short_bitmap_auto_options[];
extern struct option long_options[];
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 41edf6f45895193f4a523cb0a08d639c9ff9ccc9 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:12 -0600
Subject: [PATCH 37/52] mdadm: Fix optional --write-behind parameter
Subject: [PATCH 37/83] mdadm: Fix optional --write-behind parameter
The commit noted below changed the behaviour of --write-behind to
require an argument. This broke the 06wrmostly test with the error:
@ -38,5 +38,5 @@ index d0c5e6de..56722ed9 100644
optarg);
exit(2);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 7539254342bc591717b0051734cc6c09c1b88640 Mon Sep 17 00:00:00 2001
From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Date: Wed, 22 Jun 2022 14:25:13 -0600
Subject: [PATCH 38/52] tests/00raid0: add a test that validates raid0 with
Subject: [PATCH 38/83] tests/00raid0: add a test that validates raid0 with
layout fails for 0.9
329dfc28debb disallows the creation of raid0 with layouts for 0.9
@ -34,5 +34,5 @@ index 8bc18985..e6b21cc4 100644
# now with no superblock
mdadm -B $md0 -l0 -n5 $dev0 $dev1 $dev2 $dev3 $dev4
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 14c2161edb77d7294199e8aa7daa9f9d1d0ad5d7 Mon Sep 17 00:00:00 2001
From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Date: Wed, 22 Jun 2022 14:25:14 -0600
Subject: [PATCH 39/52] tests: fix raid0 tests for 0.90 metadata
Subject: [PATCH 39/83] tests: fix raid0 tests for 0.90 metadata
Some of the test cases fail because raid0 creation fails with the error,
"0.90 metadata does not support layouts for RAID0" added by commit,
@ -95,5 +95,5 @@ index 232fc1ff..08c14af7 100644
s=${ls#*/} l=${ls%/*}
mdadm -CR --assume-clean -e 0.90 $md0 --level $l -n 4 -c 64 $dlist
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From de045db607b1ac4b70fc2a8878463e029c2ab1dc Mon Sep 17 00:00:00 2001
From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Date: Wed, 22 Jun 2022 14:25:15 -0600
Subject: [PATCH 40/52] tests/04update-metadata: avoid passing chunk size to
Subject: [PATCH 40/83] tests/04update-metadata: avoid passing chunk size to
raid1
'04update-metadata' test fails with error, "specifying chunk size is
@ -35,5 +35,5 @@ index 08c14af7..2b72a303 100644
mdadm -S $md0
mdadm -A $md0 --update=metadata $dlist
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From a2c832465fc75202e244327b2081231dfa974617 Mon Sep 17 00:00:00 2001
From: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
Date: Wed, 22 Jun 2022 14:25:16 -0600
Subject: [PATCH 41/52] tests/02lineargrow: clear the superblock at every
Subject: [PATCH 41/83] tests/02lineargrow: clear the superblock at every
iteration
This fixes 02lineargrow test as prior metadata causes --add operation
@ -27,5 +27,5 @@ index e05c219d..595bf9f2 100644
+ mdadm --zero /dev/loop3
done
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From a7bfcc716e235664dfb3b6c5a9590273e611ac72 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:17 -0600
Subject: [PATCH 42/52] mdadm/test: Add a mode to repeat specified tests
Subject: [PATCH 42/83] mdadm/test: Add a mode to repeat specified tests
Many tests fail infrequently or rarely. To help find these, add
an option to run the tests multiple times by specifying --loop=N.
@ -84,5 +84,5 @@ index 711a3c7a..da6db5e0 100755
}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 28520bf114b3b0515a48ff44fff4ecbe9ed6dfad Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:18 -0600
Subject: [PATCH 43/52] mdadm/test: Mark and ignore broken test failures
Subject: [PATCH 43/83] mdadm/test: Mark and ignore broken test failures
Add functionality to continue if a test marked as broken fails.
@ -116,5 +116,5 @@ index da6db5e0..61d9ee83 100755
fi
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From daa86d6634761796ada1f535c13e47fdd3cc95eb Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 22 Jun 2022 14:25:19 -0600
Subject: [PATCH 44/52] tests: Add broken files for all broken tests
Subject: [PATCH 44/83] tests: Add broken files for all broken tests
Each broken file contains the rough frequency of brokeness as well
as a brief explanation of what happens when it breaks. Estimates
@ -443,5 +443,5 @@ index 00000000..e91a1425
+
+ "should detect errors"
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 239b3cc0b5da87e966746533b1873c439db54b16 Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Fri, 12 Aug 2022 16:36:02 +0200
Subject: [PATCH 45/52] mdadm: Replace obsolete usleep with nanosleep
Subject: [PATCH 45/83] mdadm: Replace obsolete usleep with nanosleep
According to POSIX.1-2001, usleep is considered obsolete.
Replace it with a wrapper that uses nanosleep, as recommended in man.
@ -312,5 +312,5 @@ index 38f0420e..ca48d976 100644
+ } while (!wake_after_interrupt && errno == EINTR);
+}
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 39b381252c32275079344d30de18b76fda4bba26 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 27 Jul 2022 15:52:45 -0600
Subject: [PATCH 46/52] tests/00readonly: Run udevadm settle before setting ro
Subject: [PATCH 46/83] tests/00readonly: Run udevadm settle before setting ro
In some recent kernel versions, 00readonly fails with:
@ -32,5 +32,5 @@ index 39202487..afe243b3 100644
check readonly
state=$(cat /sys/block/md0/md/array_state)
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From b7671c82010ffc04dfaecff2dd19ef8b2283e2b6 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 19 Jul 2022 14:48:21 +0200
Subject: [PATCH 47/52] tests: add test for names
Subject: [PATCH 47/83] tests: add test for names
Current behavior is not documented and tested. This test is a base for
future improvements. It is enough to test it only with native metadata,
@ -115,5 +115,5 @@ index 00000000..64b81b92
+_verify "/dev/md0" "empty" "name"
+mdadm -S "/dev/md0"
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From e4a030a0d3a953b8e74c118200e58dc83c2fc608 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 19 Jul 2022 14:48:22 +0200
Subject: [PATCH 48/52] mdadm: remove symlink option
Subject: [PATCH 48/83] mdadm: remove symlink option
The option is not used. Remove it from code.
@ -172,5 +172,5 @@ index add9c0b6..93e72786 100644
Waitclean,
DetailPlatform,
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From ae5dfc56b7a96805d5a0b50eaf93b9fec8604298 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 19 Jul 2022 14:48:23 +0200
Subject: [PATCH 49/52] mdadm: move data_offset to struct shape
Subject: [PATCH 49/83] mdadm: move data_offset to struct shape
Data offset is a shape property so move it there to remove additional
parameter from some functions.
@ -228,5 +228,5 @@ index 93e72786..adb7cdaa 100644
extern int Detail(char *dev, struct context *c);
extern int Detail_Platform(struct superswitch *ss, int scan, int verbose, int export, char *controller_path);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 27ad4900501c615b7c6b266bf23948e5606dba53 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 27 Jul 2022 15:52:46 -0600
Subject: [PATCH 50/52] mdadm: Don't open md device for CREATE and ASSEMBLE
Subject: [PATCH 50/83] mdadm: Don't open md device for CREATE and ASSEMBLE
The mdadm command tries to open the md device for most modes, first
thing, no matter what. When running to create or assemble an array,
@ -158,5 +158,5 @@ index adb7cdaa..8208b81e 100644
extern void udev_block(char *devnm);
extern void udev_unblock(void);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 7211116c295ba1f9e1fcbdc2dd2d3762855062e1 Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Thu, 28 Jul 2022 20:20:53 +0800
Subject: [PATCH 51/52] Grow: Split Grow_reshape into helper function
Subject: [PATCH 51/83] Grow: Split Grow_reshape into helper function
Grow_reshape should be split into helper functions given its size.
- Add helper function for preparing reshape on external metadata.
@ -227,5 +227,5 @@ index ca48d976..26ffdcea 100644
{
/* like 'open', but if 'dev' matches %d:%d, create a temp
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 5c3c3df646dd3b7e8df81152f08e9ac4ddccc671 Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Fri, 19 Aug 2022 02:55:46 +0200
Subject: [PATCH 52/52] Assemble: check if device is container before
Subject: [PATCH 52/83] Assemble: check if device is container before
scheduling force-clean update
Up to now using assemble with force flag making each array as clean.
@ -32,5 +32,5 @@ index be2160b4..1dd82a8c 100644
devices[chosen_drive].devname, c->verbose,
0, NULL);
--
2.31.1
2.38.1

@ -1,7 +1,7 @@
From 171e9743881edf2dfb163ddff483566fbf913ccd Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Fri, 26 Aug 2022 08:55:56 +1000
Subject: [PATCH 53/63] super1: report truncated device
Subject: [PATCH 53/83] super1: report truncated device
When the metadata is at the start of the device, it is possible that it
describes a device large than the one it is actually stored on. When

@ -1,7 +1,7 @@
From 1a386f804d8392b849b3362da6b0157b0db83091 Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Fri, 12 Aug 2022 16:52:12 +0200
Subject: [PATCH 54/63] mdadm: Correct typos, punctuation and grammar in man
Subject: [PATCH 54/83] mdadm: Correct typos, punctuation and grammar in man
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Reviewed-by: Wol <anthony@youngman.org.uk>

@ -1,7 +1,7 @@
From fc6fd4063769f4194c3fb8f77b32b2819e140fb9 Mon Sep 17 00:00:00 2001
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
Date: Thu, 18 Aug 2022 11:47:21 +0200
Subject: [PATCH 55/63] Manage: Block unsafe member failing
Subject: [PATCH 55/83] Manage: Block unsafe member failing
Kernel may or may not block mdadm from removing member device if it
will cause arrays failed state. It depends on raid personality

@ -1,7 +1,7 @@
From 55c10e4de13abe3e6934895e1fff7d2d20d0b2c2 Mon Sep 17 00:00:00 2001
From: Pawel Baldysiak <pawel.baldysiak@intel.com>
Date: Thu, 1 Sep 2022 11:20:31 +0200
Subject: [PATCH 56/63] Monitor: Fix statelist memory leaks
Subject: [PATCH 56/83] Monitor: Fix statelist memory leaks
Free statelist in error path in Monitor initialization.

@ -1,7 +1,7 @@
From ea7a02a3294aae223e1329aed5da7f4aa3ac05c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= <oldium.pro@gmail.com>
Date: Wed, 31 Aug 2022 19:57:29 +0200
Subject: [PATCH 57/63] mdadm: added support for Intel Alderlake RST on VMD
Subject: [PATCH 57/83] mdadm: added support for Intel Alderlake RST on VMD
platform
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8

@ -1,7 +1,7 @@
From ea109700563d93704ebdc540c7770d874369f667 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Fri, 9 Sep 2022 15:50:33 +0200
Subject: [PATCH 58/63] mdadm: Add Documentation entries to systemd services
Subject: [PATCH 58/83] mdadm: Add Documentation entries to systemd services
Add documentation section.
Copied from Debian.

@ -1,7 +1,7 @@
From f7cbd810b639eb946ba1b3bddb1faefb9696de42 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Fri, 9 Sep 2022 15:50:34 +0200
Subject: [PATCH 59/63] ReadMe: fix command-line help
Subject: [PATCH 59/83] ReadMe: fix command-line help
Make command-line help consistent with manual page.
Copied from Debian.

@ -1,7 +1,7 @@
From 6f2af6a48c541f207cb727a31fb86de2cd04fc21 Mon Sep 17 00:00:00 2001
From: Kinga Tanska <kinga.tanska@intel.com>
Date: Fri, 2 Sep 2022 08:49:23 +0200
Subject: [PATCH 60/63] mdadm: replace container level checking with inline
Subject: [PATCH 60/83] mdadm: replace container level checking with inline
To unify all containers checks in code, is_container() function is
added and propagated.

@ -1,7 +1,7 @@
From 8b668d4aa3305af5963162b7499b128bd71f8f29 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Date: Thu, 22 Sep 2022 08:29:50 +0200
Subject: [PATCH 61/63] Mdmonitor: Omit non-md devices
Subject: [PATCH 61/83] Mdmonitor: Omit non-md devices
Fix segfault commit [1] introduced check whether given device is
mddevice, but it happend to terminate Mdmonitor if at least one of given

@ -1,31 +0,0 @@
From 75f23f662fdfd6709be3d1d554d435cc0aa33443 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 21 Sep 2022 14:43:50 -0600
Subject: [PATCH 62/63] Create: goto abort_locked instead of return 1 in error
path
The return 1 after the fstat_is_blkdev() check should be replaced
with an error return that goes through the error path to unlock
resources locked by this function.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
Create.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Create.c b/Create.c
index 953e7372..2e8203ec 100644
--- a/Create.c
+++ b/Create.c
@@ -939,7 +939,7 @@ int Create(struct supertype *st, char *mddev,
goto abort_locked;
}
if (!fstat_is_blkdev(fd, dv->devname, &rdev))
- return 1;
+ goto abort_locked;
inf->disk.major = major(rdev);
inf->disk.minor = minor(rdev);
}
--
2.38.1

@ -0,0 +1,233 @@
From 3698867194f27fdd7824b8bdd172d619a2c087cc Mon Sep 17 00:00:00 2001
From: Mateusz Grzonka <mateusz.grzonka@intel.com>
Date: Wed, 7 Sep 2022 14:56:49 +0200
Subject: [PATCH 62/83] Mdmonitor: Split alert() into separate functions
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
---
Monitor.c | 186 ++++++++++++++++++++++++++++--------------------------
1 file changed, 95 insertions(+), 91 deletions(-)
diff --git a/Monitor.c b/Monitor.c
index 7d7dc4d2..0036e8cd 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -66,7 +66,7 @@ struct alert_info {
static int make_daemon(char *pidfile);
static int check_one_sharer(int scan);
static void write_autorebuild_pid(void);
-static void alert(char *event, char *dev, char *disc, struct alert_info *info);
+static void alert(const char *event, const char *dev, const char *disc, struct alert_info *info);
static int check_array(struct state *st, struct mdstat_ent *mdstat,
int test, struct alert_info *info,
int increments, char *prefer);
@@ -407,111 +407,115 @@ static void write_autorebuild_pid()
}
}
-static void alert(char *event, char *dev, char *disc, struct alert_info *info)
+static void execute_alert_cmd(const char *event, const char *dev, const char *disc, struct alert_info *info)
+{
+ int pid = fork();
+
+ switch (pid) {
+ default:
+ waitpid(pid, NULL, 0);
+ break;
+ case -1:
+ pr_err("Cannot fork to execute alert command");
+ break;
+ case 0:
+ execl(info->alert_cmd, info->alert_cmd, event, dev, disc, NULL);
+ exit(2);
+ }
+}
+
+static void send_event_email(const char *event, const char *dev, const char *disc, struct alert_info *info)
+{
+ FILE *mp, *mdstat;
+ char hname[256];
+ char buf[BUFSIZ];
+ int n;
+
+ mp = popen(Sendmail, "w");
+ if (!mp) {
+ pr_err("Cannot open pipe stream for sendmail.\n");
+ return;
+ }
+
+ gethostname(hname, sizeof(hname));
+ signal(SIGPIPE, SIG_IGN);
+ if (info->mailfrom)
+ fprintf(mp, "From: %s\n", info->mailfrom);
+ else
+ fprintf(mp, "From: %s monitoring <root>\n", Name);
+ fprintf(mp, "To: %s\n", info->mailaddr);
+ fprintf(mp, "Subject: %s event on %s:%s\n\n", event, dev, hname);
+ fprintf(mp, "This is an automatically generated mail message. \n");
+ fprintf(mp, "A %s event had been detected on md device %s.\n\n", event, dev);
+
+ if (disc && disc[0] != ' ')
+ fprintf(mp,
+ "It could be related to component device %s.\n\n", disc);
+ if (disc && disc[0] == ' ')
+ fprintf(mp, "Extra information:%s.\n\n", disc);
+
+ mdstat = fopen("/proc/mdstat", "r");
+ if (!mdstat) {
+ pr_err("Cannot open /proc/mdstat\n");
+ pclose(mp);
+ return;
+ }
+
+ fprintf(mp, "The /proc/mdstat file currently contains the following:\n\n");
+ while ((n = fread(buf, 1, sizeof(buf), mdstat)) > 0)
+ n = fwrite(buf, 1, n, mp);
+ fclose(mdstat);
+ pclose(mp);
+}
+
+static void log_event_to_syslog(const char *event, const char *dev, const char *disc)
{
int priority;
+ /* Log at a different severity depending on the event.
+ *
+ * These are the critical events: */
+ if (strncmp(event, "Fail", 4) == 0 ||
+ strncmp(event, "Degrade", 7) == 0 ||
+ strncmp(event, "DeviceDisappeared", 17) == 0)
+ priority = LOG_CRIT;
+ /* Good to know about, but are not failures: */
+ else if (strncmp(event, "Rebuild", 7) == 0 ||
+ strncmp(event, "MoveSpare", 9) == 0 ||
+ strncmp(event, "Spares", 6) != 0)
+ priority = LOG_WARNING;
+ /* Everything else: */
+ else
+ priority = LOG_INFO;
+ if (disc && disc[0] != ' ')
+ syslog(priority,
+ "%s event detected on md device %s, component device %s", event, dev, disc);
+ else if (disc)
+ syslog(priority, "%s event detected on md device %s: %s", event, dev, disc);
+ else
+ syslog(priority, "%s event detected on md device %s", event, dev);
+}
+
+static void alert(const char *event, const char *dev, const char *disc, struct alert_info *info)
+{
if (!info->alert_cmd && !info->mailaddr && !info->dosyslog) {
time_t now = time(0);
printf("%1.15s: %s on %s %s\n", ctime(&now) + 4,
event, dev, disc?disc:"unknown device");
}
- if (info->alert_cmd) {
- int pid = fork();
- switch(pid) {
- default:
- waitpid(pid, NULL, 0);
- break;
- case -1:
- break;
- case 0:
- execl(info->alert_cmd, info->alert_cmd,
- event, dev, disc, NULL);
- exit(2);
- }
- }
+ if (info->alert_cmd)
+ execute_alert_cmd(event, dev, disc, info);
+
if (info->mailaddr && (strncmp(event, "Fail", 4) == 0 ||
strncmp(event, "Test", 4) == 0 ||
strncmp(event, "Spares", 6) == 0 ||
strncmp(event, "Degrade", 7) == 0)) {
- FILE *mp = popen(Sendmail, "w");
- if (mp) {
- FILE *mdstat;
- char hname[256];
-
- gethostname(hname, sizeof(hname));
- signal_s(SIGPIPE, SIG_IGN);
-
- if (info->mailfrom)
- fprintf(mp, "From: %s\n", info->mailfrom);
- else
- fprintf(mp, "From: %s monitoring <root>\n",
- Name);
- fprintf(mp, "To: %s\n", info->mailaddr);
- fprintf(mp, "Subject: %s event on %s:%s\n\n",
- event, dev, hname);
-
- fprintf(mp,
- "This is an automatically generated mail message from %s\n", Name);
- fprintf(mp, "running on %s\n\n", hname);
-
- fprintf(mp,
- "A %s event had been detected on md device %s.\n\n", event, dev);
-
- if (disc && disc[0] != ' ')
- fprintf(mp,
- "It could be related to component device %s.\n\n", disc);
- if (disc && disc[0] == ' ')
- fprintf(mp, "Extra information:%s.\n\n", disc);
-
- fprintf(mp, "Faithfully yours, etc.\n");
-
- mdstat = fopen("/proc/mdstat", "r");
- if (mdstat) {
- char buf[8192];
- int n;
- fprintf(mp,
- "\nP.S. The /proc/mdstat file currently contains the following:\n\n");
- while ((n = fread(buf, 1, sizeof(buf),
- mdstat)) > 0)
- n = fwrite(buf, 1, n, mp);
- fclose(mdstat);
- }
- pclose(mp);
- }
+ send_event_email(event, dev, disc, info);
}
- /* log the event to syslog maybe */
- if (info->dosyslog) {
- /* Log at a different severity depending on the event.
- *
- * These are the critical events: */
- if (strncmp(event, "Fail", 4) == 0 ||
- strncmp(event, "Degrade", 7) == 0 ||
- strncmp(event, "DeviceDisappeared", 17) == 0)
- priority = LOG_CRIT;
- /* Good to know about, but are not failures: */
- else if (strncmp(event, "Rebuild", 7) == 0 ||
- strncmp(event, "MoveSpare", 9) == 0 ||
- strncmp(event, "Spares", 6) != 0)
- priority = LOG_WARNING;
- /* Everything else: */
- else
- priority = LOG_INFO;
-
- if (disc && disc[0] != ' ')
- syslog(priority,
- "%s event detected on md device %s, component device %s", event, dev, disc);
- else if (disc)
- syslog(priority,
- "%s event detected on md device %s: %s",
- event, dev, disc);
- else
- syslog(priority,
- "%s event detected on md device %s",
- event, dev);
- }
+ if (info->dosyslog)
+ log_event_to_syslog(event, dev, disc);
}
static int check_array(struct state *st, struct mdstat_ent *mdstat,
--
2.38.1

@ -1,59 +0,0 @@
From 249da94563dddb852ccb52164411ff99a6c90489 Mon Sep 17 00:00:00 2001
From: Logan Gunthorpe <logang@deltatee.com>
Date: Wed, 21 Sep 2022 14:43:51 -0600
Subject: [PATCH 63/63] Create: remove safe_mode_delay local variable
All .getinfo_super() call sets the info.safe_mode_delay variables
to a constant value, so no matter what the current state is
that function will always set it to the same value.
Create() calls .getinfo_super() multiple times while creating the array.
The value is stored in a local variable for every disk in the loop
to add disks (so the last disc call takes precedence). The local
variable is then used in the call to sysfs_set_safemode().
This can be simplified by using info.safe_mode_delay directly. The info
variable had .getinfo_super() called on it early in the function so, by the
reasoning above, it will have the same value as the local variable which
can thus be removed.
Doing this allows for factoring out code from Create() in a subsequent
patch.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
Create.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Create.c b/Create.c
index 2e8203ec..8ded81dc 100644
--- a/Create.c
+++ b/Create.c
@@ -137,7 +137,6 @@ int Create(struct supertype *st, char *mddev,
int did_default = 0;
int do_default_layout = 0;
int do_default_chunk = 0;
- unsigned long safe_mode_delay = 0;
char chosen_name[1024];
struct map_ent *map = NULL;
unsigned long long newsize;
@@ -952,7 +951,6 @@ int Create(struct supertype *st, char *mddev,
goto abort_locked;
}
st->ss->getinfo_super(st, inf, NULL);
- safe_mode_delay = inf->safe_mode_delay;
if (have_container && c->verbose > 0)
pr_err("Using %s for device %d\n",
@@ -1065,7 +1063,7 @@ int Create(struct supertype *st, char *mddev,
"readonly");
break;
}
- sysfs_set_safemode(&info, safe_mode_delay);
+ sysfs_set_safemode(&info, info.safe_mode_delay);
if (err) {
pr_err("failed to activate array.\n");
ioctl(mdfd, STOP_ARRAY, NULL);
--
2.38.1

@ -0,0 +1,41 @@
From f40ac0e7e6043361ad12e9db97c07e56c3977cf6 Mon Sep 17 00:00:00 2001
From: Blazej Kucman <blazej.kucman@intel.com>
Date: Mon, 19 Dec 2022 11:21:57 +0100
Subject: [PATCH 63/83] Monitor: block if monitor modes are combined.
Block monitoring start if --scan mode and MD devices list are combined.
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
---
Monitor.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Monitor.c b/Monitor.c
index 0036e8cd..188cb8be 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -123,7 +123,7 @@ int Monitor(struct mddev_dev *devlist,
* and if we can get_disk_info and find a name
* Then we hot-remove and hot-add to the other array
*
- * If devlist is NULL, then we can monitor everything because --scan
+ * If devlist is NULL, then we can monitor everything if --scan
* was given. We get an initial list from config file and add anything
* that appears in /proc/mdstat
*/
@@ -136,6 +136,11 @@ int Monitor(struct mddev_dev *devlist,
struct mddev_ident *mdlist;
int delay_for_event = c->delay;
+ if (devlist && c->scan) {
+ pr_err("Devices list and --scan option cannot be combined - not monitoring.\n");
+ return 1;
+ }
+
if (!mailaddr)
mailaddr = conf_get_mailaddr();
--
2.38.1

@ -0,0 +1,119 @@
From 725e37cd14866906ba28c970394b9f7a4cd97413 Mon Sep 17 00:00:00 2001
From: Blazej Kucman <blazej.kucman@intel.com>
Date: Mon, 19 Dec 2022 11:21:58 +0100
Subject: [PATCH 64/83] Update mdadm Monitor manual.
- describe monitor work modes,
- clarify the turning off condition,
- describe the mdmonitor.service as a prefered management way.
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
---
mdadm.8.in | 71 ++++++++++++++++++++++++