summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-31 01:57:42 +0100
committerNeilBrown <neilb@suse.de>2011-01-31 01:57:42 +0100
commitde171cb9a52598cc023adceafc6c166112401386 (patch)
tree56fc899c45b538dedba0fc139e3213a0f47f9a59 /drivers/md
parentMerge branch 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/ker... (diff)
downloadlinux-de171cb9a52598cc023adceafc6c166112401386.tar.xz
linux-de171cb9a52598cc023adceafc6c166112401386.zip
md: revert change to raid_disks on failure.
If we try to update_raid_disks and it fails, we should put 'delta_disks' back to zero. This is important because some code, such as slot_store, assumes that delta_disks has been validated. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b76cfc89e1b5..e636e404e9a5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5578,6 +5578,8 @@ static int update_raid_disks(mddev_t *mddev, int raid_disks)
mddev->delta_disks = raid_disks - mddev->raid_disks;
rv = mddev->pers->check_reshape(mddev);
+ if (rv < 0)
+ mddev->delta_disks = 0;
return rv;
}