From bcec0e8d347a5f01552fd966e1bbc167e33ac1a4 Mon Sep 17 00:00:00 2001 From: Wang Di Date: Wed, 13 Aug 2014 12:34:01 -0700 Subject: [PATCH] LU-5312 ptlrpc: update export_last_request_time after recovery Update export_last_request_time after recovery, because client can not send ping to the server during the recovery, so we need refresh the last_request_time to avoid the export is being evicted earlier than it should be. Change-Id: I1d9bf5aaa3ca4215479ddc942c7052ad047c6989 Signed-off-by: Wang Di Reviewed-on: http://review.whamcloud.com/11443 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/include/lustre_net.h | 1 + lustre/ldlm/ldlm_lib.c | 6 +++++- lustre/ptlrpc/service.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 3ed63bf..80541df 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -3112,6 +3112,7 @@ int ptlrpc_service_health_check(struct ptlrpc_service *); void ptlrpc_server_drop_request(struct ptlrpc_request *req); void ptlrpc_request_change_export(struct ptlrpc_request *req, struct obd_export *export); +void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay); #ifdef __KERNEL__ int ptlrpc_hr_init(void); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f0f94d4..1c370e6 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -2061,7 +2061,11 @@ static int target_recovery_thread(void *arg) libcfs_nid2str(req->rq_peer.nid)); handle_recovery_req(thread, req, trd->trd_recovery_handler); - target_request_copy_put(req); + /* Because the waiting client can not send ping to server, + * so we need refresh the last_request_time, to avoid the + * export is being evicted */ + ptlrpc_update_export_timer(req->rq_export, 0); + target_request_copy_put(req); } delta = (jiffies - delta) / HZ; diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 069e05b..b7918e1 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -1058,7 +1058,7 @@ static void ptlrpc_server_finish_active_request( * This function is only called when some export receives a message (i.e., * the network is up.) */ -static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) +void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) { struct obd_export *oldest_exp; time_t oldest_time, new_time; @@ -1133,6 +1133,7 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) EXIT; } +EXPORT_SYMBOL(ptlrpc_update_export_timer); /** * Sanity check request \a req. -- 1.8.3.1