Whamcloud - gitweb
LU-9286 ptlrpc: fix wrong error handlers 19/26319/2
authorAlexander Boyko <alexander.boyko@seagate.com>
Mon, 3 Apr 2017 11:35:53 +0000 (14:35 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Apr 2017 04:44:53 +0000 (04:44 +0000)
If ptlrpc_request_pack finish with 0, we need to call
ptlrpc_req_finished for later errors.

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Seagate-bug-id: MRP-4285
Change-Id: I97dec565c1aa95c4457b32cb5d72b4f8abdd3d1d
Reviewed-on: https://review.whamcloud.com/26319
Tested-by: Jenkins
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdc/mdc_request.c
lustre/osc/osc_request.c
lustre/osp/osp_object.c
lustre/quota/qsd_request.c

index fd811e1..418453a 100644 (file)
@@ -900,7 +900,7 @@ restart_bulk:
                                    MDS_BULK_PORTAL,
                                    &ptlrpc_bulk_kiov_pin_ops);
        if (desc == NULL) {
-               ptlrpc_request_free(req);
+               ptlrpc_req_finished(req);
                RETURN(-ENOMEM);
        }
 
index d2086a1..3c4150a 100644 (file)
@@ -650,7 +650,7 @@ static int osc_destroy(const struct lu_env *env, struct obd_export *exp,
                rc = l_wait_event_exclusive(cli->cl_destroy_waitq,
                                            osc_can_send_destroy(cli), &lwi);
                if (rc) {
-                       ptlrpc_request_free(req);
+                       ptlrpc_req_finished(req);
                        RETURN(rc);
                }
        }
index fc823e3..e0e0073 100644 (file)
@@ -1737,10 +1737,8 @@ static int osp_it_fetch(const struct lu_env *env, struct osp_it *it)
                                    PTLRPC_BULK_PUT_SINK | PTLRPC_BULK_BUF_KIOV,
                                    MDS_BULK_PORTAL,
                                    &ptlrpc_bulk_kiov_pin_ops);
-       if (desc == NULL) {
-               ptlrpc_request_free(req);
-               RETURN(-ENOMEM);
-       }
+       if (desc == NULL)
+               GOTO(out, rc = -ENOMEM);
 
        for (i = 0; i < npages; i++)
                desc->bd_frag_ops->add_kiov_frag(desc, pages[i], 0,
index dca5af3..152ba90 100644 (file)
@@ -392,10 +392,8 @@ int qsd_fetch_index(const struct lu_env *env, struct obd_export *exp,
                                    PTLRPC_BULK_PUT_SINK | PTLRPC_BULK_BUF_KIOV,
                                    MDS_BULK_PORTAL,
                                    &ptlrpc_bulk_kiov_pin_ops);
-       if (desc == NULL) {
-               ptlrpc_request_free(req);
-               RETURN(-ENOMEM);
-       }
+       if (desc == NULL)
+               GOTO(out, rc = -ENOMEM);
 
        /* req now owns desc and will free it when it gets freed */
        for (i = 0; i < npages; i++)