From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Kwolek Subject: [PATCH 1/2] md/raid5: FIX: manually-added spare is not used Date: Fri, 14 Jan 2011 14:00:00 +0100 Message-ID: <20110114130000.15648.52870.stgit@gklab-128-013.igk.intel.com> References: <20110114125537.15648.73873.stgit@gklab-128-013.igk.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110114125537.15648.73873.stgit@gklab-128-013.igk.intel.com> Sender: linux-raid-owner@vger.kernel.org To: neilb@suse.de Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com, ed.ciechanowski@intel.com, wojciech.neubauer@intel.com List-Id: linux-raid.ids Manually added spares are not used due to fact that they not added to md configuration. Counters are updated only. Signed-off-by: Adam Kwolek --- drivers/md/raid5.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a2087c7..59c4150 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5592,8 +5592,10 @@ static int raid5_start_reshape(mddev_t *mddev) } else if (rdev->raid_disk >= conf->previous_raid_disks && !test_bit(Faulty, &rdev->flags)) { /* This is a spare that was manually added */ - set_bit(In_sync, &rdev->flags); - added_devices++; + if (raid5_add_disk(mddev, rdev) == 0) { + set_bit(In_sync, &rdev->flags); + added_devices++; + } } /* When a reshape changes the number of devices, ->degraded