X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_lib.c;h=44bdcd46db0414f226950c3b55db3a62e5c1e311;hp=0541f7bd1ffc3aea429c45b1d2b0035d14d508e5;hb=737da0331e8407a704cd11c04f18c2cd3d437800;hpb=7de9e8dd313557997fb28f3926516b5c26d31c9a diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 0541f7b..44bdcd4 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -857,7 +857,6 @@ int target_handle_connect(struct ptlrpc_request *req) cfs_spin_lock(&export->exp_lock); export->exp_connecting = 1; cfs_spin_unlock(&export->exp_lock); - class_export_put(export); LASSERT(export->exp_obd == target); rc = target_handle_reconnect(&conn, export, &cluuid); @@ -945,8 +944,12 @@ dont_check_exports: rc = obd_connect(req->rq_svc_thread->t_env, &export, target, &cluuid, data, client_nid); - if (rc == 0) + if (rc == 0) { conn.cookie = export->exp_handle.h_cookie; + /* LU-1092 reconnect put export refcount in the + * end, connect needs take one here too. */ + class_export_get(export); + } } } else { rc = obd_reconnect(req->rq_svc_thread->t_env, @@ -1036,7 +1039,9 @@ dont_check_exports: &export->exp_connection->c_peer.nid, &export->exp_nid_hash); } - + /** + class_disconnect->class_export_recovery_cleanup() race + */ if (target->obd_recovering && !export->exp_in_recovery) { int has_transno; __u64 transno = data->ocd_transno; @@ -1129,6 +1134,8 @@ out: cfs_spin_lock(&export->exp_lock); export->exp_connecting = 0; cfs_spin_unlock(&export->exp_lock); + + class_export_put(export); } if (targref) class_decref(targref, __FUNCTION__, cfs_current());