From: Bobi Jam Date: Sun, 29 Jan 2017 00:05:03 +0000 (-0500) Subject: staging: lustre: lov: ld_target could be NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=098b325b8fc3bb1e000cadbae538e20cd1ee1fa7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: lustre: 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8018 Reviewed-on: http://review.whamcloud.com/21411 Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 9c4b5ab83d9d..977579c9c519 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -266,6 +266,13 @@ static int lov_init_raid0(const struct lu_env *env, struct lov_device *dev, if (result != 0) goto out; + if (!dev->ld_target[ost_idx]) { + CERROR("%s: OST %04x is not initialized\n", + lov2obd(dev->ld_lov)->obd_name, ost_idx); + result = -EIO; + goto out; + } + subdev = lovsub2cl_dev(dev->ld_target[ost_idx]); subconf->u.coc_oinfo = oinfo; LASSERTF(subdev, "not init ost %d\n", ost_idx);