From 8cf149edfcf0ab8345aa46e771ec67a9f539b5c6 Mon Sep 17 00:00:00 2001 From: yury Date: Sun, 6 Nov 2005 15:27:19 +0000 Subject: [PATCH] - fixes, improvemtns, more verbosity. --- lustre/include/linux/lustre_idl.h | 3 --- lustre/obdclass/genops.c | 23 +++++++++++++++-------- lustre/obdfilter/filter.c | 2 +- lustre/osc/osc_create.c | 8 ++++---- lustre/ptlrpc/import.c | 5 +++-- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index b7fc6aa..596a682 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -229,9 +229,6 @@ struct obd_connect_data { __u64 padding[8]; }; -#define OCD_CROW_ABLE(ocd) \ - ((ocd)->ocd_connect_flags & OBD_CONNECT_CROW) - extern void lustre_swab_connect(struct obd_connect_data *ocd); /* diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 043714d..e094a15 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -1054,12 +1054,13 @@ static int ping_evictor_main(void *arg) class_export_get(exp); spin_unlock(&obd->obd_dev_lock); LCONSOLE_WARN("%s: haven't heard from %s in %ld" - " seconds. I think it's dead, " - "and I am evicting it.\n", - obd->obd_name, + " seconds. Last request was at %ld. " + "I think it's dead, and I am evicting " + "it.\n", obd->obd_name, obd_export_nid2str(exp), (long)(CURRENT_SECONDS - - exp->exp_last_request_time)); + exp->exp_last_request_time), + exp->exp_last_request_time); class_fail_export(exp); @@ -1166,15 +1167,21 @@ void class_update_export_timer(struct obd_export *exp, time_t extra_delay) /* Note - racing to start/reset the obd_eviction timer is safe */ if (exp->exp_obd->obd_eviction_timer == 0) { + unsigned long interval = PING_INTERVAL; + /* Check if the oldest entry is expired. */ if (CURRENT_SECONDS > (oldest_time + (3 * obd_timeout / 2) + extra_delay)) { - /* We need a second timer, in case the net was - * down and it just came back. Since the pinger - * may skip every other PING_INTERVAL (see note in + /* We need a second timer, in case the net was down and + * it just came back. Since the pinger may skip every + * other {PING|STATFS}_INTERVAL (see note in * ptlrpc_pinger_main), we better wait for 3. */ + + if (IMP_CROW_ABLE(class_exp2cliimp(exp))) + interval = STATFS_INTERVAL; + exp->exp_obd->obd_eviction_timer = CURRENT_SECONDS + - 3 * PING_INTERVAL; + 3 * interval; CDEBUG(D_HA, "%s: Think about evicting %s from %ld\n", exp->exp_obd->obd_name, obd_export_nid2str(exp), oldest_time); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 3aba587..6dd8aa0 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2659,7 +2659,7 @@ static int filter_create(struct obd_export *exp, struct obdo *oa, } } else { CERROR("wrong @oa flags detected 0x%lx. Not an urgent " - "create and not recovery\n", oa->o_flags); + "create and not recovery.\n", (unsigned long)oa->o_flags); LBUG(); } RETURN(rc); diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index d831832..fe2e611 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -109,7 +109,6 @@ int osc_create(struct obd_export *exp, struct obdo *oa, struct lov_stripe_md **ea, struct obd_trans_info *oti) { struct osc_creator *oscc = &exp->exp_obd->u.cli.cl_oscc; - struct obd_connect_data *ocd; int try_again = 1, rc = 0; ENTRY; @@ -163,13 +162,14 @@ int osc_create(struct obd_export *exp, struct obdo *oa, !!(oa->o_flags & OBD_FL_CREATE_CROW) != !!(oa->o_flags & OBD_FL_RECREATE_OBJS))); - ocd = &class_exp2cliimp(exp)->imp_connect_data; - /* perform urgent create if asked or import is not crow capable or * ENOSPC case if detected. */ - if (OBDO_URGENT_CREATE(oa) || !OCD_CROW_ABLE(ocd) || + if (OBDO_URGENT_CREATE(oa) || !IMP_CROW_ABLE(class_exp2cliimp(exp)) || osc_check_nospc(exp)) { CDEBUG(D_HA, "perform urgent create\n"); + oa->o_flags &= ~OBD_FL_CREATE_CROW; + if (!oa->o_flags) + oa->o_valid &= ~OBD_MD_FLFLAGS; rc = osc_real_create(exp, oa, ea, oti); RETURN(rc); } diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 3469e4f..19e24f7 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -557,11 +557,12 @@ finish: imp->imp_connect_data.ocd_connect_flags) == ocd->ocd_connect_flags); - if (OCD_CROW_ABLE(ocd)) { + imp->imp_connect_data = *ocd; + + if (IMP_CROW_ABLE(imp)) { CDEBUG(D_HA, "connected to CROW capable target: %s\n", imp->imp_target_uuid.uuid); } - imp->imp_connect_data = *ocd; if (imp->imp_conn_current != NULL) { list_del(&imp->imp_conn_current->oic_item); list_add(&imp->imp_conn_current->oic_item, -- 1.8.3.1