From c2c8a3f6dec17144f317aab409f48b862d9aa1b1 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Wed, 21 Mar 2018 23:21:08 +0800 Subject: [PATCH] LU-10368 mdc: resend quotactl if needed In mdc_quotactl, it is better to resend the quotactl request if reconnection or failover is triggered during the process. Lustre-change: https://review.whamcloud.com/31773 Lustre-commit: d511918e8eb725abba2561cc493e30651a89ac27 Change-Id: I64f96863a6f10026aa69cba3c59095966b58b98d Signed-off-by: Hongchao Zhang Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/32075 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- lustre/mdc/mdc_request.c | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 1152829..681e5bd 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1818,38 +1818,37 @@ static int mdc_ioc_hsm_ct_start(struct obd_export *exp, static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp, struct obd_quotactl *oqctl) { - struct ptlrpc_request *req; - struct obd_quotactl *oqc; - int rc; - ENTRY; + struct ptlrpc_request *req; + struct obd_quotactl *oqc; + int rc; + ENTRY; - req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), - &RQF_MDS_QUOTACTL, LUSTRE_MDS_VERSION, - MDS_QUOTACTL); - if (req == NULL) - RETURN(-ENOMEM); + req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), + &RQF_MDS_QUOTACTL, LUSTRE_MDS_VERSION, + MDS_QUOTACTL); + if (req == NULL) + RETURN(-ENOMEM); - oqc = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL); - *oqc = *oqctl; + oqc = req_capsule_client_get(&req->rq_pill, &RMF_OBD_QUOTACTL); + *oqc = *oqctl; - ptlrpc_request_set_replen(req); - ptlrpc_at_set_req_timeout(req); - req->rq_no_resend = 1; + ptlrpc_request_set_replen(req); + ptlrpc_at_set_req_timeout(req); - rc = ptlrpc_queue_wait(req); - if (rc) - CERROR("ptlrpc_queue_wait failed, rc: %d\n", rc); - - if (req->rq_repmsg && - (oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL))) { - *oqctl = *oqc; - } else if (!rc) { - CERROR ("Can't unpack obd_quotactl\n"); - rc = -EPROTO; - } - ptlrpc_req_finished(req); + rc = ptlrpc_queue_wait(req); + if (rc) + CERROR("ptlrpc_queue_wait failed, rc: %d\n", rc); + + if (req->rq_repmsg && + (oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL))) { + *oqctl = *oqc; + } else if (!rc) { + CERROR ("Can't unpack obd_quotactl\n"); + rc = -EPROTO; + } + ptlrpc_req_finished(req); - RETURN(rc); + RETURN(rc); } static int mdc_ioc_swap_layouts(struct obd_export *exp, -- 1.8.3.1