Whamcloud - gitweb
r=shadow
authoryury <yury>
Wed, 24 Dec 2008 13:00:31 +0000 (13:00 +0000)
committeryury <yury>
Wed, 24 Dec 2008 13:00:31 +0000 (13:00 +0000)
- 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

index 888b7f3..b03b3f6 100644 (file)
@@ -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);