From 1ea95cfcb2ba519dde9c0cac72b444ab73b78c86 Mon Sep 17 00:00:00 2001 From: yury Date: Wed, 24 Dec 2008 13:02:56 +0000 Subject: [PATCH] r=shadow - check for OBD_FAIL_OBD_LLOG_SETUP fail_loc regardless ->lop_setup definition. This is required because after changes in mds_ost llog setup, which is now done on behalf of separate thread, we need to make llog_setup() fail in context of mds start thread to make the test actualy work. And those llogs which get initialized in mds start thread do not have ->lop_setup defined. --- lustre/obdclass/llog_obd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index 888b7f3..b03b3f6 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -182,16 +182,17 @@ int llog_setup(struct obd_device *obd, int index, struct obd_device *disk_obd, ctxt->loc_logops = op; sema_init(&ctxt->loc_sem, 1); - if (op->lop_setup) { - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LLOG_SETUP)) - rc = -EOPNOTSUPP; - else + if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LLOG_SETUP)) { + rc = -EOPNOTSUPP; + } else { + if (op->lop_setup) rc = op->lop_setup(obd, index, disk_obd, count, logid); } if (rc) { - llog_ctxt_destroy(ctxt); - obd->obd_llog_ctxt[index] = NULL; + CERROR("obd %s ctxt %d lop_setup=%p failed %d\n", + obd->obd_name, index, op->lop_setup, rc); + llog_ctxt_put(ctxt); } out: mutex_up(&obd->obd_llog_alloc); -- 1.8.3.1