diff options
author | NeilBrown <neilb@suse.de> | 2013-12-12 10:13:33 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-25 08:27:12 -0800 |
commit | bb4a65df3097524be403d455176710aee14d41f7 (patch) | |
tree | 51b1817c03b7799797b3c17f719d5acd75d50518 /drivers/md/md.h | |
parent | ba8ee5985099dbd8f01ac5dcc7ad8ddf23056e87 (diff) | |
download | linux-3.10-bb4a65df3097524be403d455176710aee14d41f7.tar.gz linux-3.10-bb4a65df3097524be403d455176710aee14d41f7.tar.bz2 linux-3.10-bb4a65df3097524be403d455176710aee14d41f7.zip |
md: fix problem when adding device to read-only array with bitmap.
commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 upstream.
If an array is started degraded, and then the missing device
is found it can be re-added and a minimal bitmap-based recovery
will bring it fully up-to-date.
If the array is read-only a recovery would not be allowed.
But also if the array is read-only and the missing device was
present very recently, then there could be no need for any
recovery at all, so we simply include the device in the read-only
array without any recovery.
However... if the missing device was removed a little longer ago
it could be missing some updates, but if a bitmap is present it will
be conditionally accepted pending a bitmap-based update. We don't
currently detect this case properly and will include that old
device into the read-only array with no recovery even though it really
needs a recovery.
This patch keeps track of whether a bitmap-based-recovery is really
needed or not in the new Bitmap_sync rdev flag. If that is set,
then the device will not be added to a read-only array.
Cc: Andrei Warkentin <andreiw@vmware.com>
Fixes: d70ed2e4fafdbef0800e73942482bb075c21578b
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 653f992b687..ebe748e5741 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -129,6 +129,9 @@ struct md_rdev { enum flag_bits { Faulty, /* device is known to have a fault */ In_sync, /* device is in_sync with rest of array */ + Bitmap_sync, /* ..actually, not quite In_sync. Need a + * bitmap-based recovery to get fully in sync + */ Unmerged, /* device is being added to array and should * be considerred for bvec_merge_fn but not * yet for actual IO |