From b15361e754b7584744db6bd8fe3cd73c7ef008c5 Mon Sep 17 00:00:00 2001 From: rread Date: Thu, 16 Oct 2003 00:44:02 +0000 Subject: [PATCH] - fix llog_test so loads and runs again. - clean up error case in class_config_parse_log --- lustre/obdclass/llog_test.c | 26 ++++++++++++++++++++++---- lustre/obdclass/obd_config.c | 5 +---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index 6f9e099..c4451d0 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -348,26 +348,44 @@ static int llog_test_6(struct obd_device *obd, char * name) struct lustre_handle exph = {0, }; struct obd_export * exp; struct obd_uuid uuid = {"LLOG_TEST6_UUID"}; + struct llog_handle *llh = NULL; int rc; CERROR("6a: re-open log %s using client API\n", name); mdc_obd = class_find_client_obd(mds_uuid, LUSTRE_MDC_NAME, NULL); if (mdc_obd == NULL) { - CERROR("No MDC devices connected to %s found.\n", + CERROR("6: no MDC devices connected to %s found.\n", mds_uuid->uuid); RETURN(-ENOENT); } rc = obd_connect(&exph, mdc_obd, &uuid); if (rc) { - CERROR("Failed to connect to MDC: %s\n", mdc_obd->obd_name); + CERROR("6: failed to connect to MDC: %s\n", mdc_obd->obd_name); RETURN(rc); } exp = class_conn2export(&exph); - rc = mdc_llog_process(exp, name, llog_test6_process_rec, NULL); + rc = llog_create(obd, &llh, NULL, name); + if (rc) { + CERROR("6: llog_create failed %d\n", rc); + RETURN(rc); + } + + rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL); + if (rc) { + CERROR("6: llog_init_handle failed %d\n", rc); + GOTO(parse_out, rc); + } + + rc = llog_process(llh, llog_test6_process_rec, NULL); +parse_out: + if (rc) + CERROR("6: llog_process failed %d\n", rc); + + rc = llog_close(llh); if (rc) { - CERROR("mdc_llog_process failed: rc = %d\n", rc); + CERROR("6: llog_close failed: rc = %d\n", rc); } rc = obd_disconnect(exp, 0); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 043fd97..e38e9a0 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -556,11 +556,8 @@ int class_config_parse_llog(struct obd_export *exp, char *name, } rc = llog_create(obd, &llh, NULL, name); - if (rc) { - class_export_put(obd->obd_log_exp); - obd->obd_log_exp = NULL; + if (rc) RETURN(rc); - } rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL); if (rc) -- 1.8.3.1