#define OBD_FAIL_TGT_FAKE_EXP 0x708
#define OBD_FAIL_TGT_REPLAY_DELAY 0x709
#define OBD_FAIL_TGT_LAST_REPLAY 0x710
+#define OBD_FAIL_TGT_CLIENT_ADD 0x711
#define OBD_FAIL_MDC_REVALIDATE_PAUSE 0x800
#define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801
memcpy(lcd->lcd_uuid, cluuid, sizeof lcd->lcd_uuid);
lexp->exp_mdt_data.med_lcd = lcd;
rc = mdt_client_new(env, mdt);
- if (rc != 0) {
- OBD_FREE_PTR(lcd);
- lexp->exp_mdt_data.med_lcd = NULL;
- } else {
+ if (rc == 0)
mdt_export_stats_init(obd, lexp, localdata);
- }
- } else
+ } else {
rc = -ENOMEM;
+ }
}
out:
/* Write new client data. */
off = med->med_lr_off;
+
+ if (OBD_FAIL_CHECK(OBD_FAIL_TGT_CLIENT_ADD))
+ RETURN(-ENOSPC);
+
mdt_trans_credit_init(env, mdt, MDT_TXN_LAST_RCVD_WRITE_OP);
th = mdt_trans_start(env, mdt);
CDEBUG(D_INFO, "writing client lcd at idx %u (%llu) (len %u)\n",
fed->fed_lr_idx,off,(unsigned int)sizeof(*fed->fed_lcd));
+ if (OBD_FAIL_CHECK(OBD_FAIL_TGT_CLIENT_ADD))
+ RETURN(-ENOSPC);
+
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
/* Transaction needed to fix bug 1403 */
handle = fsfilt_start(obd,
cleanup:
if (rc) {
- if (lcd) {
- OBD_FREE_PTR(lcd);
- fed->fed_lcd = NULL;
- }
class_disconnect(lexp);
lprocfs_exp_cleanup(lexp);
*exp = NULL;
}
run_test 28 "handle error adding new clients (bug 6086)"
+test_29a() { # bug 22273 - error adding new clients
+ #define OBD_FAIL_TGT_CLIENT_ADD 0x711
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000711"
+ # fail abort so client will be new again
+ fail_abort $SINGLEMDS
+ client_up || error "reconnect failed"
+ return 0
+}
+run_test 29a "error adding new clients doesn't cause LBUG (bug 22273)"
+
+test_29b() { # bug 22273 - error adding new clients
+ #define OBD_FAIL_TGT_CLIENT_ADD 0x711
+ do_facet ost1 "lctl set_param fail_loc=0x80000711"
+ # fail abort so client will be new again
+ fail_abort ost1
+ client_up || error "reconnect failed"
+ return 0
+}
+run_test 29b "error adding new clients doesn't cause LBUG (bug 22273)"
+
test_50() {
mkdir -p $DIR/$tdir
# put a load of file creates/writes/deletes