diff options
Diffstat (limited to 'meta/recipes-extended/mdadm/files/0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch')
| -rw-r--r-- | meta/recipes-extended/mdadm/files/0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch b/meta/recipes-extended/mdadm/files/0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch new file mode 100644 index 0000000000..72cb40f782 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 2296a4a441b4b8546e2eb32403930f1bb8f3ee4a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Logan Gunthorpe <logang@deltatee.com> | ||
| 3 | Date: Wed, 22 Jun 2022 14:25:10 -0600 | ||
| 4 | Subject: [PATCH 4/4] monitor: Avoid segfault when calling NULL get_bad_blocks | ||
| 5 | |||
| 6 | Not all struct superswitch implement a get_bad_blocks() function, | ||
| 7 | yet mdmon seems to call it without checking for NULL and thus | ||
| 8 | occasionally segfaults in the test 10ddf-geometry. | ||
| 9 | |||
| 10 | Fix this by checking for NULL before calling it. | ||
| 11 | |||
| 12 | Signed-off-by: Logan Gunthorpe <logang@deltatee.com> | ||
| 13 | Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | ||
| 14 | Signed-off-by: Jes Sorensen <jes@trained-monkey.org> | ||
| 15 | |||
| 16 | Upstream-Status: Backport | ||
| 17 | |||
| 18 | Reference to upstream patch: | ||
| 19 | https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=9ae62977b51d | ||
| 20 | |||
| 21 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 22 | --- | ||
| 23 | monitor.c | 3 +++ | ||
| 24 | 1 file changed, 3 insertions(+) | ||
| 25 | |||
| 26 | diff --git a/monitor.c b/monitor.c | ||
| 27 | index afc3e50..8e43c0d 100644 | ||
| 28 | --- a/monitor.c | ||
| 29 | +++ b/monitor.c | ||
| 30 | @@ -312,6 +312,9 @@ static int check_for_cleared_bb(struct active_array *a, struct mdinfo *mdi) | ||
| 31 | struct md_bb *bb; | ||
| 32 | int i; | ||
| 33 | |||
| 34 | + if (!ss->get_bad_blocks) | ||
| 35 | + return -1; | ||
| 36 | + | ||
| 37 | /* | ||
| 38 | * Get a list of bad blocks for an array, then read list of | ||
| 39 | * acknowledged bad blocks from kernel and compare it against metadata | ||
| 40 | -- | ||
| 41 | 2.39.1 | ||
| 42 | |||
