md: change hot_remove_disk to take an rdev rather than a number.
Soon an array will be able to have multiple devices with the same raid_disk number (an original and a replacement). So removing a device based on the number won't work. So pass the actual device handle instead. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
@@ -1327,16 +1327,15 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int raid1_remove_disk(struct mddev *mddev, int number)
|
||||
static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
{
|
||||
struct r1conf *conf = mddev->private;
|
||||
int err = 0;
|
||||
struct md_rdev *rdev;
|
||||
int number = rdev->raid_disk;
|
||||
struct mirror_info *p = conf->mirrors+ number;
|
||||
|
||||
print_conf(conf);
|
||||
rdev = p->rdev;
|
||||
if (rdev) {
|
||||
if (rdev == p->rdev) {
|
||||
if (test_bit(In_sync, &rdev->flags) ||
|
||||
atomic_read(&rdev->nr_pending)) {
|
||||
err = -EBUSY;
|
||||
|
Reference in New Issue
Block a user