static inline struct lu_target *class_exp2tgt(struct obd_export *exp)
{
LASSERT(exp->exp_obd);
+ if (exp->exp_obd->u.obt.obt_magic != OBT_MAGIC)
+ return NULL;
return exp->exp_obd->u.obt.obt_lut;
}
ENTRY;
tgt = class_exp2tgt(req->rq_export);
+ if (unlikely(tgt == NULL)) {
+ DEBUG_REQ(D_ERROR, req, "%s: No target for connected export\n",
+ class_exp2obd(req->rq_export)->obd_name);
+ RETURN(ERR_PTR(-EINVAL));
+ }
for (s = tgt->lut_slice; s->tos_hs != NULL; s++)
if (s->tos_opc_start <= opc && opc < s->tos_opc_end)
else
tsi->tsi_jobid = NULL;
+ if (tgt == NULL) {
+ DEBUG_REQ(D_ERROR, req, "%s: No target for connected export\n",
+ class_exp2obd(req->rq_export)->obd_name);
+ req->rq_status = -EINVAL;
+ rc = ptlrpc_error(req);
+ GOTO(out, rc);
+ }
+
request_fail_id = tgt->lut_request_fail_id;
tsi->tsi_reply_fail_id = tgt->lut_reply_fail_id;
RETURN(0);
}
+ if (unlikely(tgt == NULL)) {
+ DEBUG_REQ(D_ERROR, req, "%s: No target for connected export\n",
+ class_exp2obd(req->rq_export)->obd_name);
+ RETURN(-EINVAL);
+ }
+
client = libcfs_nid2str(req->rq_peer.nid);
/* no GSS support case */
if (!req->rq_auth_gss) {
struct sptlrpc_rule_set tmp_rset;
int rc;
+ if (unlikely(tgt == NULL)) {
+ CERROR("No target passed");
+ return -EINVAL;
+ }
+
sptlrpc_rule_set_init(&tmp_rset);
rc = sptlrpc_conf_target_get_rules(tgt->lut_obd, &tmp_rset, initial);
if (rc) {
tgt = class_exp2tgt(lock->l_export);
+ if (unlikely(tgt == NULL)) {
+ CDEBUG(D_ERROR, "%s: No target for connected export\n",
+ class_exp2obd(lock->l_export)->obd_name);
+ RETURN(-EINVAL);
+ }
+
if (flag == LDLM_CB_CANCELING &&
(lock->l_granted_mode & (LCK_PW | LCK_GROUP)) &&
(tgt->lut_sync_lock_cancel == ALWAYS_SYNC_ON_CANCEL ||
if (ted->ted_lr_idx < 0)
return;
/* Clear bit when lcd is freed */
- LASSERT(lut->lut_client_bitmap);
+ LASSERT(lut && lut->lut_client_bitmap);
if (!test_and_clear_bit(ted->ted_lr_idx, lut->lut_client_bitmap)) {
CERROR("%s: client %u bit already clear in bitmap\n",
exp->exp_obd->obd_name, ted->ted_lr_idx);
ENTRY;
+ if (unlikely(tgt == NULL)) {
+ CDEBUG(D_ERROR, "%s: No target for connected export\n",
+ class_exp2obd(exp)->obd_name);
+ RETURN(-EINVAL);
+ }
+
th = dt_trans_create(env, tgt->lut_bottom);
if (IS_ERR(th))
RETURN(PTR_ERR(th));
struct lsd_client_data *lcd = exp->exp_target_data.ted_lcd;
struct lu_target *tgt = class_exp2tgt(exp);
- LASSERT(tgt->lut_bottom);
+ LASSERT(tgt && tgt->lut_bottom);
/** VBR: set client last_epoch to current epoch */
if (lcd->lcd_last_epoch >= tgt->lut_lsd.lsd_start_epoch)
return;
ENTRY;
- LASSERT(tgt->lut_client_bitmap != NULL);
+ LASSERT(tgt && tgt->lut_client_bitmap != NULL);
if (!strcmp(ted->ted_lcd->lcd_uuid, tgt->lut_obd->obd_uuid.uuid))
RETURN(0);
ENTRY;
- LASSERT(tgt->lut_client_bitmap != NULL);
+ LASSERT(tgt && tgt->lut_client_bitmap != NULL);
LASSERTF(idx >= 0, "%d\n", idx);
if (!strcmp(ted->ted_lcd->lcd_uuid, tgt->lut_obd->obd_uuid.uuid) ||
LASSERT(ted->ted_lcd);
+ if (unlikely(tgt == NULL)) {
+ CDEBUG(D_ERROR, "%s: No target for connected export\n",
+ class_exp2obd(exp)->obd_name);
+ RETURN(-EINVAL);
+ }
+
/* XXX if lcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
if (!strcmp((char *)ted->ted_lcd->lcd_uuid,
(char *)tgt->lut_obd->obd_uuid.uuid) ||