Whamcloud - gitweb
LU-5939 hsm: make HSM modification requests replayable 84/13684/3
authorMikhail Pershin <mike.pershin@intel.com>
Mon, 9 Feb 2015 03:44:46 +0000 (06:44 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 8 May 2015 14:57:59 +0000 (14:57 +0000)
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 <mike.pershin@intel.com>
Change-Id: I39810f99e99fadb76a96facf903405f6c85cc71f
Reviewed-on: http://review.whamcloud.com/13684
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdc/mdc_request.c
lustre/target/tgt_handler.c

index c1d241f..56fcc0d 100644 (file)
@@ -1616,7 +1616,10 @@ static int mdc_ioc_hsm_progress(struct obd_export *exp,
 
        ptlrpc_request_set_replen(req);
 
 
        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);
        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);
 
 
        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;
 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);
 
 
        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:
        GOTO(out, rc);
 
 out:
index 39caceb..051cbab 100644 (file)
@@ -472,6 +472,9 @@ static int tgt_filter_recovery_request(struct ptlrpc_request *req,
        case OST_SETATTR:
        case OST_SYNC:
        case OST_WRITE:
        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);
 
                *process = target_queue_recovery_request(req, obd);
                RETURN(0);