dm raid: fix panic when attempting to force a raid to sync
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 2 Nov 2017 18:58:28 +0000 (19:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Dec 2017 14:08:00 +0000 (15:08 +0100)
commit2c727856d07198ca0c0d054480e608f0f759f6c5
treed67da8b2f446e1900584e39189146fee713e9bb6
parent0ad0bb60166d8e4fbacaaaaaeb10a24de5e99aff
dm raid: fix panic when attempting to force a raid to sync

[ Upstream commit 233978449074ca7e45d9c959f9ec612d1b852893 ]

Requesting a sync on an active raid device via a table reload
(see 'sync' parameter in Documentation/device-mapper/dm-raid.txt)
skips the super_load() call that defines the superblock size
(rdev->sb_size) -- resulting in an oops if/when super_sync()->memset()
is called.

Fix by moving the initialization of the superblock start and size
out of super_load() to the caller (analyse_superblocks).

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid.c