md: fix regression with re-adding devices to arrays with no metadata
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 22:03:35 +0000 (09:03 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 22:03:35 +0000 (09:03 +1100)
commitbf572541ab44240163eaa2d486b06f306a31d45a
treeef9630d692ce3681bf226877056622afd070f1c0
parent3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
md: fix regression with re-adding devices to arrays with no metadata

Commit 1a855a0606 (2.6.37-rc4) fixed a problem where devices were
re-added when they shouldn't be but caused a regression in a less
common case that means sometimes devices cannot be re-added when they
should be.

In particular, when re-adding a device to an array without metadata
we should always access the device, but after the above commit we
didn't.

This patch sets the In_sync flag in that case so that the re-add
succeeds.

This patch is suitable for any -stable kernel to which 1a855a0606 was
applied.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c