From: tappro Date: Wed, 20 Aug 2008 20:00:25 +0000 (+0000) Subject: - vbr interoperability with 1.6 X-Git-Tag: v1_7_80~1^14~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=007371475e77c3b4d704082ace77746519dd72b2;p=fs%2Flustre-release.git - vbr interoperability with 1.6 b:15942 i:rread, bzzz --- diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 5ee9e67..4cb3f3b 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -758,7 +758,13 @@ void class_unlink_export(struct obd_export *exp) list_del_init(&exp->exp_obd_chain_timed); exp->exp_obd->obd_num_exports--; spin_unlock(&exp->exp_obd->obd_dev_lock); - + /* Keep these counter valid always */ + spin_lock_bh(&exp->exp_obd->obd_processing_task_lock); + if (exp->exp_delayed) + exp->exp_obd->obd_delayed_clients--; + else + exp->exp_obd->obd_recoverable_clients--; + spin_unlock_bh(&exp->exp_obd->obd_processing_task_lock); class_export_put(exp); } EXPORT_SYMBOL(class_unlink_export); @@ -1101,17 +1107,24 @@ EXPORT_SYMBOL(class_set_export_delayed); */ void class_handle_stale_exports(struct obd_device *obd) { - struct list_head delay_list; + struct list_head delay_list, evict_list; struct obd_export *exp, *n; ENTRY; CFS_INIT_LIST_HEAD(&delay_list); + CFS_INIT_LIST_HEAD(&evict_list); spin_lock(&obd->obd_dev_lock); list_for_each_entry_safe(exp, n, &obd->obd_exports, exp_obd_chain) { - if (exp->exp_replay_needed && !exp->exp_delayed && - (obd->obd_version_recov || !exp->exp_in_recovery)) { - list_move_tail(&exp->exp_obd_chain, &delay_list); + /* clients finished recovery or delayed */ + if (!exp->exp_replay_needed || exp->exp_delayed) + continue; + /* connected non-vbr clients are evicted */ + if (exp->exp_in_recovery && !exp_connect_vbr(exp)) { + list_move_tail(&exp->exp_obd_chain, &evict_list); + continue; } + if (obd->obd_version_recov || !exp->exp_in_recovery) + list_move_tail(&exp->exp_obd_chain, &delay_list); } spin_unlock(&obd->obd_dev_lock); @@ -1123,6 +1136,9 @@ void class_handle_stale_exports(struct obd_device *obd) list_splice(&delay_list, obd->obd_exports.prev); spin_unlock(&obd->obd_dev_lock); + /* evict clients without VBR support */ + class_disconnect_export_list(&evict_list, get_exp_flags_from_obd(obd)); + EXIT; } EXPORT_SYMBOL(class_handle_stale_exports);