dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Grow_continue_command-ensure-content-is-properly-ini.patch

b7f731
From a250ce240f245df594570a5e25398680d403af67 Mon Sep 17 00:00:00 2001
b7f731
From: NeilBrown <neilb@suse.com>
b7f731
Date: Thu, 20 Apr 2017 12:40:05 +1000
b7f731
Subject: [RHEL7.5 PATCH 087/169] Grow_continue_command: ensure 'content'
b7f731
 is properly initialised.
b7f731
b7f731
Grow_continue_command() call verify_reshape_position(), which assumes
b7f731
that info->sys_name is initialised.
b7f731
'info' in verify_reshape_position() is 'content' in Grow_continue_command().
b7f731
b7f731
In the st->ss->external != 0 branch of that function, sysfs_init() is called
b7f731
to initialize content->sys_name.
b7f731
In the st->ss->external == 0 branch, ->sys_name is not initialized so
b7f731
verify_reshape_position() will not do the right thing.
b7f731
b7f731
Signed-off-by: NeilBrown <neilb@suse.com>
b7f731
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
b7f731
---
b7f731
 Grow.c | 1 +
b7f731
 1 file changed, 1 insertion(+)
b7f731
b7f731
diff --git a/Grow.c b/Grow.c
b7f731
index 15f4ed1..c6967ed 100755
b7f731
--- a/Grow.c
b7f731
+++ b/Grow.c
b7f731
@@ -5002,6 +5002,7 @@ int Grow_continue_command(char *devname, int fd,
b7f731
 			goto Grow_continue_command_exit;
b7f731
 		}
b7f731
 		content = &array;
b7f731
+		sysfs_init(content, fd, NULL);
b7f731
 		/* Need to load a superblock.
b7f731
 		 * FIXME we should really get what we need from
b7f731
 		 * sysfs
b7f731
-- 
b7f731
2.7.4
b7f731