From 9eda825b1b449baaf2676cc80ccae79d4297cf2d Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Mon, 9 Feb 2015 06:44:46 +0300 Subject: [PATCH] LU-5939 hsm: make HSM modification requests replayable There are several HSM requests which modify data on server and reply on Lustre recovery, e.g. they should replay changes in case of recovery. Patch allows such requests to be replayed in recovery time and they are issued from client using mdc_rpc_lock to serialize them and avoid concurrent last_rcvd update on server. Signed-off-by: Mikhail Pershin Change-Id: I39810f99e99fadb76a96facf903405f6c85cc71f Reviewed-on: http://review.whamcloud.com/13684 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- lustre/mdc/mdc_request.c | 17 ++++++++++++----- lustre/target/tgt_handler.c | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index c1d241f..56fcc0d 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1616,7 +1616,10 @@ static int mdc_ioc_hsm_progress(struct obd_export *exp, ptlrpc_request_set_replen(req); - rc = mdc_queue_wait(req); + mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); + rc = ptlrpc_queue_wait(req); + mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); + GOTO(out, rc); out: ptlrpc_req_finished(req); @@ -1798,10 +1801,11 @@ static int mdc_ioc_hsm_state_set(struct obd_export *exp, ptlrpc_request_set_replen(req); - rc = mdc_queue_wait(req); - GOTO(out, rc); + mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); + rc = ptlrpc_queue_wait(req); + mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); - EXIT; + GOTO(out, rc); out: ptlrpc_req_finished(req); return rc; @@ -1857,7 +1861,10 @@ static int mdc_ioc_hsm_request(struct obd_export *exp, ptlrpc_request_set_replen(req); - rc = mdc_queue_wait(req); + mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); + rc = ptlrpc_queue_wait(req); + mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL); + GOTO(out, rc); out: diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 39caceb..051cbab 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -472,6 +472,9 @@ static int tgt_filter_recovery_request(struct ptlrpc_request *req, case OST_SETATTR: case OST_SYNC: case OST_WRITE: + case MDS_HSM_PROGRESS: + case MDS_HSM_STATE_SET: + case MDS_HSM_REQUEST: *process = target_queue_recovery_request(req, obd); RETURN(0); -- 1.8.3.1