Merge branch 'md-next' of https://github.com/liu-song-6/linux into for-5.1/block
Pull MD changes for 5.1 from Song. * 'md-next' of https://github.com/liu-song-6/linux: raid1: simplify raid1_error function md-linear: use struct_size() in kzalloc()
This commit is contained in:
commit
09e5740370
|
@ -96,8 +96,7 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks)
|
|||
int i, cnt;
|
||||
bool discard_supported = false;
|
||||
|
||||
conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(struct dev_info),
|
||||
GFP_KERNEL);
|
||||
conf = kzalloc(struct_size(conf, disks, raid_disks), GFP_KERNEL);
|
||||
if (!conf)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -1603,11 +1603,9 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev)
|
|||
return;
|
||||
}
|
||||
set_bit(Blocked, &rdev->flags);
|
||||
if (test_and_clear_bit(In_sync, &rdev->flags)) {
|
||||
if (test_and_clear_bit(In_sync, &rdev->flags))
|
||||
mddev->degraded++;
|
||||
set_bit(Faulty, &rdev->flags);
|
||||
} else
|
||||
set_bit(Faulty, &rdev->flags);
|
||||
set_bit(Faulty, &rdev->flags);
|
||||
spin_unlock_irqrestore(&conf->device_lock, flags);
|
||||
/*
|
||||
* if recovery is running, make sure it aborts.
|
||||
|
|
Loading…
Reference in New Issue