OSDN Git Service

dm raid: fix RAID leg rebuild errors
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 6 Sep 2018 20:54:29 +0000 (22:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:56:01 +0000 (08:56 +0200)
commit8a100be2813a4807c3a9f20e878478972e2a27db
treea3f2854cfa21f81628c1e73a66cf4df882a6004d
parent659cd50c8acead411de4b90493e9ab63d3e30e53
dm raid: fix RAID leg rebuild errors

[ Upstream commit 36a240a706d43383bbdd377522501ddd2e5771f6 ]

On fast devices such as NVMe, a flaw in rs_get_progress() results in
false target status output when userspace lvm2 requests leg rebuilds
(symptom of the failure is device health chars 'aaaaaaaa' instead of
expected 'aAaAAAAA' causing lvm2 to fail).

The correct sync action state definitions already exist in
decipher_sync_action() so fix rs_get_progress() to use it.

Change decipher_sync_action() to return an enum rather than a string for
the sync states and call it from rs_get_progress().  Introduce
sync_str() to translate from enum to the string that is needed by
raid_status().

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