- rc = llog_cancel(llog_get_context(obd, cookie->lgc_subsys + 1),
- NULL, 1, cookie, 0);
- if (rc)
- CERROR("error cancelling log cookies: rc = %d\n", rc);
+ olg = filter_find_olg(obd, cookie->lgc_lgl.lgl_ogr);
+ if (!IS_ERR(olg)) {
+ ctxt = llog_group_get_ctxt(olg, cookie->lgc_subsys + 1);
+ if (!ctxt) {
+ CERROR("no valid context for group "LPU64"\n",
+ cookie->lgc_lgl.lgl_ogr);
+ GOTO(out, rc = 0);
+ }
+
+ OBD_FAIL_TIMEOUT(OBD_FAIL_OST_CANCEL_COOKIE_TIMEOUT, 30);
+
+ rc = llog_cancel(ctxt, NULL, 1, cookie, 0);
+ if (rc)
+ CERROR("error cancelling log cookies: rc = %d\n", rc);
+ llog_ctxt_put(ctxt);
+ } else {
+ CDEBUG(D_HA, "unknown group "LPU64"!\n", cookie->lgc_lgl.lgl_ogr);
+ }
+out: