From 55e7ba9999a238d4caddc918452700028d1c0481 Mon Sep 17 00:00:00 2001 From: ericm Date: Tue, 17 Mar 2009 16:08:09 +0000 Subject: [PATCH] branch: b1_8 patch from wangdi: cleanup shrink_grant callbacks only after client import has been destroied. b=18662 o=wangdi r=ericm r=huanghua --- lustre/osc/osc_request.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 16aca44..60def2c 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -957,8 +957,6 @@ static int osc_add_shrink_grant(struct client_obd *client) static int osc_del_shrink_grant(struct client_obd *client) { - CDEBUG(D_CACHE, "del grant client %s \n", - client->cl_import->imp_obd->obd_name); return ptlrpc_del_timeout_client(&client->cl_grant_shrink_list); } @@ -4048,8 +4046,26 @@ static int osc_disconnect(struct obd_export *exp) obd); } - osc_del_shrink_grant(&obd->u.cli); rc = client_disconnect_export(exp); + /** + * Initially we put del_shrink_grant before disconnect_export, but it + * causes the following problem if setup (connect) and cleanup + * (disconnect) are tangled together. + * connect p1 disconnect p2 + * ptlrpc_connect_import + * ............... class_manual_cleanup + * osc_disconnect + * del_shrink_grant + * ptlrpc_connect_interrupt + * init_grant_shrink + * add this client to shrink list + * cleanup_osc + * Bang! pinger trigger the shrink. + * So the osc should be disconnected from the shrink list, after we + * are sure the import has been destroyed. BUG18662 + */ + if (obd->u.cli.cl_import == NULL) + osc_del_shrink_grant(&obd->u.cli); return rc; } -- 1.8.3.1