Whamcloud - gitweb
Branch b1_6
authorjohann <johann>
Fri, 18 Jul 2008 10:26:57 +0000 (10:26 +0000)
committerjohann <johann>
Fri, 18 Jul 2008 10:26:57 +0000 (10:26 +0000)
b=16002
i=wangdi

Add regression test for bug 13913.

lustre/include/obd_support.h
lustre/obdclass/llog_obd.c
lustre/tests/replay-single.sh

index cc6e5db..9e7dfe3 100644 (file)
@@ -248,6 +248,7 @@ extern unsigned int obd_alloc_fail_rate;
 #define OBD_FAIL_OBD_LOGD_NET            0x602
 #define OBD_FAIL_OBD_QC_CALLBACK_NET     0x603
 #define OBD_FAIL_OBD_DQACQ               0x604
+#define OBD_FAIL_OBD_LLOG_SETUP          0x605
 
 #define OBD_FAIL_TGT_REPLY_NET           0x700
 #define OBD_FAIL_TGT_CONN_RACE           0x701
index a49c621..599e6fc 100644 (file)
@@ -151,8 +151,12 @@ 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)
-                rc = op->lop_setup(obd, index, disk_obd, count, logid);
+        if (op->lop_setup) {
+                if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LLOG_SETUP))
+                        rc = -EOPNOTSUPP;
+                else
+                        rc = op->lop_setup(obd, index, disk_obd, count, logid);
+        }
 
         if (rc) {
                 llog_ctxt_destroy(ctxt);
index baab91d..fd74e01 100755 (executable)
@@ -1331,6 +1331,16 @@ test_61c() {
 }
 run_test 61c "test race mds llog sync vs llog cleanup"
 
+test_61d() { # bug 16002
+#define OBD_FAIL_OBD_LLOG_SETUP        0x605
+    stop mds
+    do_facet mds "lctl set_param fail_loc=0x80000605"
+    start mds $MDSDEV $MDS_MOUNT_OPTS && error "mds start should have failed"
+    do_facet mds "lctl set_param fail_loc=0"
+    start mds $MDSDEV $MDS_MOUNT_OPTS || error "cannot restart mds"
+}
+run_test 61d "error in llog_setup should cleanup the llog context correctly"
+
 test_62() { # Bug 15756 - don't mis-drop resent replay
     mkdir -p $DIR/$tdir
     replay_barrier mds