lap->lap_sub_offset,
&lov_async_page_ops, lap,
&lap->lap_sub_cookie);
+ lov_tgt_decref(lov, tgt);
} else {
rc = -EIO;
}
loi = &lsm->lsm_oinfo[lap->lap_stripe];
tgt = lov->tgts + loi->loi_ost_idx;
- if (!lov_tgt_ready(lov, tgt, loi->loi_ost_gen))
- RETURN(-EIO);
-
+ if (!lov_tgt_valid(lov, tgt, loi->loi_ost_gen))
+ RETURN(-EIO);
+
rc = obd_queue_async_io(tgt->ltd_exp, lsm, loi, lap->lap_sub_cookie,
cmd, off, count, brw_flags, async_flags);
loi = &lsm->lsm_oinfo[lap->lap_stripe];
tgt = lov->tgts + loi->loi_ost_idx;
- if (!lov_tgt_ready(lov, tgt, loi->loi_ost_gen))
- RETURN(-EIO);
+ if (!lov_tgt_valid(lov, tgt, loi->loi_ost_gen))
+ RETURN(-EIO);
rc = obd_queue_group_io(tgt->ltd_exp, lsm, loi, oig,
lap->lap_sub_cookie, cmd, off, count,
loi = &lsm->lsm_oinfo[lap->lap_stripe];
tgt = lov->tgts + loi->loi_ost_idx;
+ /* FIXME: this leaks the page, but it should never really happen.
+ * Should we make this an LBUG() ? */
+ if (!lov_tgt_valid(lov, tgt, loi->loi_ost_gen)) {
+ CERROR("page found with invalid OSC !");
+ RETURN(-EIO);
+ }
+
rc = obd_teardown_async_page(tgt->ltd_exp, lsm, loi,
lap->lap_sub_cookie);
lov_tgt_decref(lov, tgt);
submd.lsm_object_id = loi->loi_id;
submd.lsm_object_gr = lsm->lsm_object_gr;
submd.lsm_stripe_count = 0;
+
+ if (!lov_tgt_valid(lov, tgt, loi->loi_ost_gen)) {
+ CDEBUG(D_HA, "lov idx %d invalid.\n", loi->loi_ost_idx);
+ continue;
+ }
rc = obd_change_cbdata(tgt->ltd_exp, &submd, it, data);
lov_tgt_decref(lov, tgt);
}
}
}
lov_tgts_unlock(lov);
+
+ /* This can happen if a deleted OST has been replaced
+ * in the lsm by the MDS. */
LDLM_ERROR(data->lock, "lock on inode without such object");
dump_lsm(D_ERROR, data->lsm);
portals_debug_dumpstack(NULL);
+
RETURN(-ENXIO);
} else if (keylen >= strlen("size_to_stripe") &&
strcmp(key, "size_to_stripe") == 0) {
cfg->cfg_instance);
lustre_cfg_bufs_set_string(&bufs, 0, inst_name);
}
- if (lcfg->lcfg_command == LCFG_ATTACH) {
- lustre_cfg_bufs_set_string(&bufs, 2,
- (char *)cfg->cfg_uuid.uuid);
- }
if (lcfg->lcfg_command == LCFG_SETUP) {
/*add cfg_instance to the end of lcfg buffers*/
lustre_cfg_bufs_set_string(&bufs,
cfg->cfg_instance);
}
}
-
+ if (cfg && (lcfg->lcfg_command == LCFG_ATTACH)) {
+ lustre_cfg_bufs_set_string(&bufs, 2,
+ (char *)cfg->cfg_uuid.uuid);
+ }
lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs);
lcfg_new->lcfg_num = lcfg->lcfg_num;