@@ -1001,15 +1001,15 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
/* Try again with the next index */
return -EAGAIN;
- imp = lov->lov_tgts[index]->ltd_exp->exp_obd->u.cli.cl_import;
- if (!lov->lov_tgts[index]->ltd_active &&
- imp->imp_state != LUSTRE_IMP_IDLE)
- return -ENODATA;
-
osc_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp);
if (!osc_obd)
return -EINVAL;
+ imp = osc_obd->u.cli.cl_import;
+ if (!lov->lov_tgts[index]->ltd_active &&
+ imp->imp_state != LUSTRE_IMP_IDLE)
+ return -ENODATA;
+
/* copy UUID */
if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(osc_obd),
min_t(unsigned long, data->ioc_plen2,