On Thu, Jul 28, 2016 at 02:16:45AM -0400, Guoqing Jiang wrote: > The new_disk_ack could return failure if WAITING_FOR_NEWDISK > is not set, so we need to kick the dev from array in case > failure happened. > > Reviewed-by: NeilBrown <neilb@xxxxxxxx> > Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx> > --- > drivers/md/md.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index 2ed547f..743cd21 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -6092,9 +6092,11 @@ static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info) > export_rdev(rdev); > > if (mddev_is_clustered(mddev)) { > - if (info->state & (1 << MD_DISK_CANDIDATE)) > - md_cluster_ops->new_disk_ack(mddev, (err == 0)); > - else { > + if (info->state & (1 << MD_DISK_CANDIDATE)) { if err != 0, we already do export_rdev, do we need to do md_kick_rdev_from_array in that case? > + err = md_cluster_ops->new_disk_ack(mddev, (err == 0)); > + if (err) > + md_kick_rdev_from_array(rdev); > + } else { > if (err) > md_cluster_ops->add_new_disk_cancel(mddev); > else > -- > 2.6.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html