]> git.baikalelectronics.ru Git - kernel.git/commit
dm raid: fix reshape race on small devices
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 6 Sep 2018 16:33:38 +0000 (18:33 +0200)
committerMike Snitzer <snitzer@redhat.com>
Thu, 6 Sep 2018 18:11:00 +0000 (14:11 -0400)
commit49bdf2db737153cc8c4413b4c5ea334945b2e592
tree1d311a77de85a638e010bc67a5b60c7ab75065ee
parentd7aa285feb7071e877dc38ff925139e0d7af7414
dm raid: fix reshape race on small devices

Loading a new mapping table, the dm-raid target's constructor
retrieves the volatile reshaping state from the raid superblocks.

When the new table is activated in a following resume, the actual
reshape position is retrieved.  The reshape driven by the previous
mapping can already have finished on small and/or fast devices thus
updating raid superblocks about the new raid layout.

This causes the actual array state (e.g. stripe size reshape finished)
to be inconsistent with the one in the new mapping, causing hangs with
left behind devices.

This race does not occur with usual raid device sizes but with small
ones (e.g. those created by the lvm2 test suite).

Fix by no longer transferring stale/inconsistent raid_set state during
preresume.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c