From: Bobi Jam Date: Tue, 19 Jul 2016 00:25:01 +0000 (+0800) Subject: LU-8018 lov: ld_target could be NULL X-Git-Tag: 2.8.59~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=916b5f7f4672c1070e27a2fe0bfae371b0a729d6;hp=676c2fe47c8de0825db3001f1e964347be3dc479 LU-8018 lov: ld_target could be NULL lov_device::ld_target[ost_idx] could be NULL if the OST target is not filled in lov_device::ld_lov::lov_tgt_desc[ost_idx] yet. Signed-off-by: Bobi Jam Change-Id: I1eddb49b3c3518828c531af568b851465ccdffa3 Reviewed-on: http://review.whamcloud.com/21411 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index 8df5f5f..cc05543 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -271,6 +271,12 @@ static int lov_init_raid0(const struct lu_env *env, struct lov_device *dev, if (result != 0) GOTO(out, result); + if (dev->ld_target[ost_idx] == NULL) { + CERROR("%s: OST %04x is not initialized\n", + lov2obd(dev->ld_lov)->obd_name, ost_idx); + GOTO(out, result = -EIO); + } + subdev = lovsub2cl_dev(dev->ld_target[ost_idx]); subconf->u.coc_oinfo = oinfo; LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);