From: dzogin Date: Mon, 21 Sep 2009 15:54:05 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_2_01~1^2~85 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7e151969bc93cccd46372da1fd3518e81d4489bc;p=fs%2Flustre-release.git Branch b1_8 b=18674 i=johann i=andrew.perepechko ---------------------------------------------------------------------- Modified Files: Tag: b1_8 lustre/ChangeLog lustre/include/lustre_import.h lustre/ptlrpc/import.c ---------------------------------------------------------------------- Details : The client also now retries to reconnect to the same server if a connect request failed with EBUSY or -EAGAIN. The patch has not been landed in the previous commits. --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 3ebd312..7cc1ca7 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -16,6 +16,14 @@ tbd Sun Microsystems, Inc. more information, please refer to bugzilla 17630. Severity : normal +Bugzilla : 18674 +Frequency : occasionally during network problems +Description: client not allowed to reconnect to OST because of active request +Details : The client also now retries to reconnect to the same server if a + connect request failed with EBUSY or -EAGAIN. The patch has not + been landed in the previous commits. + +Severity : normal Bugzilla : 19526 Description: can't stat file in some situation. Details : improve initialize osc date when target is added to mds and diff --git a/lustre/include/lustre_import.h b/lustre/include/lustre_import.h index 8fdb36e..f1e3799 100644 --- a/lustre/include/lustre_import.h +++ b/lustre/include/lustre_import.h @@ -176,7 +176,8 @@ struct obd_import { imp_pingable:1, /* pingable */ imp_resend_replay:1, /* resend for replay */ imp_recon_bk:1, /* turn off reconnect if all failovers fail */ - imp_last_recon:1; /* internally used by above */ + imp_last_recon:1, /* internally used by above */ + imp_force_reconnect:1; /* import must be reconnected instead of chouse new connection */ __u32 imp_connect_op; struct obd_connect_data imp_connect_data; __u64 imp_connect_flags_orig; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 8ea8799..c4d4222 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -482,7 +482,7 @@ static int import_select_connection(struct obd_import *imp) } /* if not found, simply choose the current one */ - if (!imp_conn) { + if (!imp_conn || imp->imp_force_reconnect) { LASSERT(imp->imp_conn_current); imp_conn = imp->imp_conn_current; tried_all = 0; @@ -761,6 +761,11 @@ static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp) EXIT; } +static int ptlrpc_busy_reconnect(int rc) +{ + return (rc == -EBUSY) || (rc == -EAGAIN); +} + static int ptlrpc_connect_interpret(struct ptlrpc_request *request, void * data, int rc) { @@ -777,18 +782,23 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request, spin_unlock(&imp->imp_lock); RETURN(0); } - spin_unlock(&imp->imp_lock); - if (rc) + if (rc) { + /* if this reconnect to busy export - not need select new target + * for connecting*/ + if (ptlrpc_busy_reconnect(rc)) + imp->imp_force_reconnect = 1; + spin_unlock(&imp->imp_lock); GOTO(out, rc); + } LASSERT(imp->imp_conn_current); msg_flags = lustre_msg_get_op_flags(request->rq_repmsg); /* All imports are pingable */ - spin_lock(&imp->imp_lock); imp->imp_pingable = 1; + imp->imp_force_reconnect = 0; if (aa->pcaa_initial_connect) { if (msg_flags & MSG_CONNECT_REPLAYABLE) {