X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flov_obd.c;h=45c57fc5f98d65ef47a7fd1f25a9397973f7fe00;hb=5a6ceb664f07;hp=e906fc82e0560b53b309114628e73a6c5a4888dc;hpb=45bb717b9d80bbe95559b45b6a8a6a49ec28e071;p=fs%2Flustre-release.git diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index e906fc82..45c57fc 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -971,27 +971,30 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, switch (cmd) { case IOC_OBD_STATFS: { - struct obd_ioctl_data *data = karg; - struct obd_device *osc_obd; - struct obd_statfs stat_buf = {0}; - __u32 index; + struct obd_ioctl_data *data = karg; + struct obd_device *osc_obd; + struct obd_statfs stat_buf = {0}; + struct obd_import *imp; + __u32 index; __u32 flags; - memcpy(&index, data->ioc_inlbuf2, sizeof(index)); - if ((index >= count)) - RETURN(-ENODEV); + memcpy(&index, data->ioc_inlbuf2, sizeof(index)); + if ((index >= count)) + RETURN(-ENODEV); - if (!lov->lov_tgts[index]) - /* Try again with the next index */ - RETURN(-EAGAIN); - if (!lov->lov_tgts[index]->ltd_active) - RETURN(-ENODATA); + if (!lov->lov_tgts[index]) + /* 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); + osc_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp); + if (!osc_obd) + RETURN(-EINVAL); - /* copy UUID */ + /* copy UUID */ if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(osc_obd), min_t(unsigned long, data->ioc_plen2, sizeof(struct obd_uuid))))