From 73890c856f41433de9f9364b7957fd6d1394593b Mon Sep 17 00:00:00 2001 From: shaver Date: Thu, 29 May 2003 00:15:32 +0000 Subject: [PATCH] More fixing for recovery-small/b=1300: - fix type of o_destroy_export - getattr reconstruction can't rely on the mcd or exp_outstanding_reply, because getattrs no longer have transnos. Happily, they don't need to. - reconstruct_open doesn't need to worry about the lock enqueued on the client's behalf, because we already fix all that up in fixup_handle_for_resent_req -- and it really doesn't need to LBUG. Fix for MCR's MDS-side recovery LBUG today: pack a reply to send when aborting queued recovery requests at timer-expiry. When we fail an LASSERT, call the LBUG upcall with the location of the assertion, not the constant-and-useless location of kportal_assertion_failed. --- lnet/include/linux/kp30.h | 17 +++++++++++++++++ lnet/libcfs/module.c | 2 +- lustre/ldlm/ldlm_lib.c | 12 +++++++++++- lustre/portals/include/linux/kp30.h | 17 +++++++++++++++++ lustre/portals/libcfs/module.c | 2 +- 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index c5ff808..6dc2ada 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -216,6 +216,14 @@ extern void kportal_assertion_failed(char *expr,char *file,char *func,int line); #endif #ifdef __arch_um__ +#define LBUG_WITH_LOC(file, func, line) \ +do { \ + CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ + portals_debug_dumplog(); \ + portals_run_lbug_upcall(file, func, line); \ + panic("LBUG"); \ +} while (0) + #define LBUG() \ do { \ CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ @@ -224,6 +232,15 @@ do { \ panic("LBUG"); \ } while (0) #else +#define LBUG_WITH_LOC(file, func, line) \ +do { \ + CEMERG("LBUG\n"); \ + portals_debug_dumplog(); \ + portals_run_lbug_upcall(file, func, line); \ + set_task_state(current, TASK_UNINTERRUPTIBLE); \ + schedule(); \ +} while (0) + #define LBUG() \ do { \ CEMERG("LBUG\n"); \ diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index c4ca2e3..5e3fcb5 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -67,7 +67,7 @@ kportal_assertion_failed (char *expr, char *file, char *func, int line) { portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 5030275..256a62f 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -30,6 +30,7 @@ #include #include #include +#include int client_import_connect(struct lustre_handle *dlm_handle, struct obd_device *obd, @@ -425,12 +426,21 @@ static void abort_recovery_queue(struct obd_device *obd) { struct ptlrpc_request *req; struct list_head *tmp, *n; + int rc; + list_for_each_safe(tmp, n, &obd->obd_recovery_queue) { req = list_entry(tmp, struct ptlrpc_request, rq_list); DEBUG_REQ(D_ERROR, req, "aborted:"); req->rq_status = -ENOTCONN; req->rq_type = PTL_RPC_MSG_ERR; - ptlrpc_reply(req); + rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, + &req->rq_repmsg); + if (rc == 0) { + ptlrpc_reply(req); + } else { + DEBUG_REQ(D_ERROR, req, + "packing failed for abort-reply; skipping"); + } list_del(&req->rq_list); class_export_put(req->rq_export); OBD_FREE(req->rq_reqmsg, req->rq_reqlen); diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index c5ff808..6dc2ada 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -216,6 +216,14 @@ extern void kportal_assertion_failed(char *expr,char *file,char *func,int line); #endif #ifdef __arch_um__ +#define LBUG_WITH_LOC(file, func, line) \ +do { \ + CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ + portals_debug_dumplog(); \ + portals_run_lbug_upcall(file, func, line); \ + panic("LBUG"); \ +} while (0) + #define LBUG() \ do { \ CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ @@ -224,6 +232,15 @@ do { \ panic("LBUG"); \ } while (0) #else +#define LBUG_WITH_LOC(file, func, line) \ +do { \ + CEMERG("LBUG\n"); \ + portals_debug_dumplog(); \ + portals_run_lbug_upcall(file, func, line); \ + set_task_state(current, TASK_UNINTERRUPTIBLE); \ + schedule(); \ +} while (0) + #define LBUG() \ do { \ CEMERG("LBUG\n"); \ diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index c4ca2e3..5e3fcb5 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -67,7 +67,7 @@ kportal_assertion_failed (char *expr, char *file, char *func, int line) { portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif -- 1.8.3.1