Sync_sbs tries to access the ->sb for the first rdev of an mddev.
This can oops as the wrong arg is given to list_entry, and also
if a define was faound to be failed, as failed devices have their ->sb
removed. But that removal isn't necessary, so now an rdev will always
have an ->sb.
MD_BUG();
return;
}
- rdev = list_entry(&mddev->disks.next, mdk_rdev_t, same_set);
+ rdev = list_entry(mddev->disks.next, mdk_rdev_t, same_set);
sb = rdev->sb;
memset(sb, 0, sizeof(*sb));
}
INIT_LIST_HEAD(&rdev->same_set);
- if (rdev->faulty && rdev->sb)
- free_disk_sb(rdev);
return rdev;
abort_free: