On Fri, Sep 21, 2012 at 11:37:27AM -0700, [email protected] wrote: > > This is a note to let you know that I've just added the patch titled > > md: make sure metadata is updated when spares are activated or removed. > > to the 3.0-stable tree which can be found at: > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > The filename of the patch is: > > md-make-sure-metadata-is-updated-when-spares-are-activated-or-removed.patch > and it can be found in the queue-3.0 subdirectory. > > If you, or anyone else, feels it should not be added to the stable tree, > please let <[email protected]> know about it. > > > >From 6dafab6b1383e912cd252fa809570b484eb6e0dc Mon Sep 17 00:00:00 2001 > From: NeilBrown <[email protected]> > Date: Wed, 19 Sep 2012 12:54:22 +1000 > Subject: md: make sure metadata is updated when spares are activated or > removed. > > From: NeilBrown <[email protected]> > > commit 6dafab6b1383e912cd252fa809570b484eb6e0dc upstream. > > It isn't always necessary to update the metadata when spares are > removed as the presence-or-not of a spare isn't really important to > the integrity of an array. > Also activating a spare doesn't always require updating the metadata > as the update on 'recovery-completed' is usually sufficient. > > However the introduction of 'replacement' devices have made these > transitions sometimes more important. For example the 'Replacement' > flag isn't cleared until the original device is removed, so we need > to ensure a metadata update after that 'spare' is removed. > > So set MD_CHANGE_DEVS whenever a spare is activated or removed, to > complement the current situation where it is set when a spare is added > or a device is failed (or a number of other less common situations). > > This is suitable for -stable as out-of-data metadata could lead > to data corruption. > This is only relevant for 3.3 and later 9when 'replacement' as > introduced. > > Signed-off-by: NeilBrown <[email protected]> > Signed-off-by: Greg Kroah-Hartman <[email protected]> > > --- > drivers/md/md.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -7139,6 +7139,8 @@ static int remove_and_add_spares(mddev_t > } > } > } > + if (removed) > + set_bit(MD_CHANGE_DEVS, &mddev->flags); > return spares; > } > > @@ -7152,9 +7154,11 @@ static void reap_sync_thread(mddev_t *md > !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { > /* success...*/ > /* activate any spares */ > - if (mddev->pers->spare_active(mddev)) > + if (mddev->pers->spare_active(mddev)) { > sysfs_notify(&mddev->kobj, NULL, > "degraded"); > + set_bit(MD_CHANGE_DEVS, &mddev->flags); > + } > } > if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && > mddev->pers->finish_reshape)
Oops, no, this patch breaks the 3.0 kernel build with the error: drivers/md/md.c: In function ‘remove_and_add_spares’: drivers/md/md.c:7142:6: error: ‘removed’ undeclared (first use in this function) drivers/md/md.c:7142:6: note: each undeclared identifier is reported only once for each function it appears in So I've dropped it from there. If someone wants to backport it properly to 3.0-stable, please resend a patch. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
