From 7cfc03d3adc835cf651cf8d7027d516d5b9c25ac Mon Sep 17 00:00:00 2001 From: ericm Date: Tue, 14 Oct 2003 10:41:41 +0000 Subject: [PATCH] again merge b_devel to b_eq: 20031014 --- lustre/ldlm/ldlm_lib.c | 22 +++++++++++++--------- lustre/mdc/mdc_internal.h | 1 + lustre/obdclass/simple.c | 14 -------------- lustre/ptlrpc/ptlrpc_lib.c | 3 +++ lustre/utils/wirecheck.c | 2 +- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index b3120db..c21b405 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -375,6 +375,10 @@ void target_destroy_export(struct obd_export *exp) exports created by lctl don't have an import */ if (exp->exp_imp_reverse != NULL) class_destroy_import(exp->exp_imp_reverse); + + /* We cancel locks at disconnect time, but this will catch any locks + * granted in a race with recovery-induced disconnect. */ + ldlm_cancel_locks_for_export(exp); } /* @@ -452,8 +456,8 @@ void target_abort_recovery(void *data) OBP(obd, postsetup)(obd); /* when recovery was abort, cleanup orphans for mds */ - if (OBT(obd) && OBP(obd, postcleanup)) { - rc = OBP(obd, postcleanup)(obd); + if (OBT(obd) && OBP(obd, postrecov)) { + rc = OBP(obd, postrecov)(obd); CERROR("Cleanup %d orphans after recovery was abort!\n", rc); } @@ -742,17 +746,17 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc) obd->obd_name); obd->obd_recovering = 0; + if (OBT(obd) && OBP(obd, postsetup)) + OBP(obd, postsetup)(obd); + /* when recovering finished, cleanup orphans for mds */ - /* there should be no orphan cleaned up for this condition */ - if (OBT(obd) && OBP(obd, postcleanup)) { + if (OBT(obd) && OBP(obd, postrecov)) { CERROR("cleanup orphans after all clients recovered\n"); - rc2 = OBP(obd, postcleanup)(obd); - LASSERT(rc2 == 0); + rc2 = OBP(obd, postrecov)(obd); + //LASSERT(rc2 == 0); + CERROR("cleanup %d orphans\n", rc2); } - if (OBT(obd) && OBP(obd, postsetup)) - OBP(obd, postsetup)(obd); - list_for_each_safe(tmp, n, &obd->obd_delayed_reply_queue) { req = list_entry(tmp, struct ptlrpc_request, rq_list); DEBUG_REQ(D_ERROR, req, "delayed:"); diff --git a/lustre/mdc/mdc_internal.h b/lustre/mdc/mdc_internal.h index 353e39d..53472e2 100644 --- a/lustre/mdc/mdc_internal.h +++ b/lustre/mdc/mdc_internal.h @@ -26,6 +26,7 @@ void mdc_rename_pack(struct ptlrpc_request *req, int offset, struct mdc_open_data { struct obd_client_handle *mod_och; + struct ptlrpc_request *mod_open_req; struct ptlrpc_request *mod_close_req; }; diff --git a/lustre/obdclass/simple.c b/lustre/obdclass/simple.c index a285fb7..722de4a 100644 --- a/lustre/obdclass/simple.c +++ b/lustre/obdclass/simple.c @@ -264,17 +264,3 @@ int lustre_fwrite(struct file *file, const void *buf, int len, loff_t *off) } EXPORT_SYMBOL(lustre_fwrite); -/* - * Sync a file from within kernel context. Prior to calling this - * function we should already have done a push_ctxt(). - */ -int lustre_fsync(struct file *file) -{ - ENTRY; - ASSERT_KERNEL_CTXT("kernel doing sync outside kernel context\n"); - if (!file || !file->f_op || !file->f_op->fsync) - RETURN(-ENOSYS); - - RETURN(file->f_op->fsync(file, file->f_dentry, 0)); -} -EXPORT_SYMBOL(lustre_fsync); diff --git a/lustre/ptlrpc/ptlrpc_lib.c b/lustre/ptlrpc/ptlrpc_lib.c index c2e90f8..8adb823 100644 --- a/lustre/ptlrpc/ptlrpc_lib.c +++ b/lustre/ptlrpc/ptlrpc_lib.c @@ -132,6 +132,9 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) cli->cl_max_mds_cookiesize = sizeof(struct llog_cookie); cli->cl_sandev = to_kdev_t(0); + + obddev->obd_logops = &llogd_client_ops; + /* Register with management client if we need to. */ if (lcfg->lcfg_inllen3 > 0) { char *mgmt_name = lcfg->lcfg_inlbuf3; diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 27c6aab..ae6e217 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -464,7 +464,7 @@ main (int argc, char **argv) CHECK_VALUE (OST_STATFS); CHECK_VALUE (OST_SAN_READ); CHECK_VALUE (OST_SAN_WRITE); - CHECK_VALUE (OST_SYNCFS); + CHECK_VALUE (OST_SYNC); CHECK_VALUE (OST_LAST_OPC); CHECK_VALUE (OST_FIRST_OPC); -- 1.8.3.1