Whamcloud - gitweb
LU-18921 ldlm: make client_obd_cleanup return void 61/58761/2
authorTimothy Day <timday@amazon.com>
Fri, 11 Apr 2025 16:02:43 +0000 (16:02 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Apr 2025 00:57:36 +0000 (00:57 +0000)
client_obd_cleanup() can never fail and it always returns
0. Make the function return void instead and fix all of the
callers.

Test-Parameters: trivial
Fixes: 911b6167a37c ("LU-3810 obd: Cleanup client import if client_obd_setup fail")
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I5a5987b4fafb712c35943620235620c6370a9f76
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58761
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Vandana Rungta <vrungta@amazon.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_net.h
lustre/ldlm/ldlm_lib.c
lustre/mgc/mgc_request.c
lustre/osc/osc_request.c
lustre/osp/lwp_dev.c
lustre/osp/osp_dev.c

index 40fa065..d4fd6c8 100644 (file)
@@ -2589,7 +2589,7 @@ ptlrpc_req2svc(struct ptlrpc_request *req)
  * @{
  */
 int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
-int client_obd_cleanup(struct obd_device *obd);
+void client_obd_cleanup(struct obd_device *obd);
 int client_connect_import(const struct lu_env *env,
                          struct obd_export **exp, struct obd_device *obd,
                          struct obd_uuid *cluuid, struct obd_connect_data *ocd,
index 80f5699..13528ca 100644 (file)
@@ -567,7 +567,7 @@ err:
 }
 EXPORT_SYMBOL(client_obd_setup);
 
-int client_obd_cleanup(struct obd_device *obd)
+void client_obd_cleanup(struct obd_device *obd)
 {
        struct client_obd *cli = &obd->u.cli;
 
@@ -585,7 +585,7 @@ int client_obd_cleanup(struct obd_device *obd)
                 BITS_TO_LONGS(OBD_MAX_RIF_MAX) * sizeof(long));
        cli->cl_mod_tag_bitmap = NULL;
 
-       RETURN(0);
+       EXIT;
 }
 EXPORT_SYMBOL(client_obd_cleanup);
 
index 672f78d..065ca67 100644 (file)
@@ -818,8 +818,6 @@ static int mgc_precleanup(struct obd_device *obd)
 
 static int mgc_cleanup(struct obd_device *obd)
 {
-       int rc;
-
        ENTRY;
 
        /* COMPAT_146 - old config logs may have added profiles secretly */
@@ -830,8 +828,8 @@ static int mgc_cleanup(struct obd_device *obd)
        lprocfs_obd_cleanup(obd);
        ptlrpcd_decref();
 
-       rc = client_obd_cleanup(obd);
-       RETURN(rc);
+       client_obd_cleanup(obd);
+       RETURN(0);
 }
 
 static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
index 7789edc..c5a1daf 100644 (file)
@@ -4036,7 +4036,6 @@ static int osc_precleanup(struct obd_device *obd)
 int osc_cleanup_common(struct obd_device *obd)
 {
        struct client_obd *cli = &obd->u.cli;
-       int rc;
 
        ENTRY;
 
@@ -4057,11 +4056,9 @@ int osc_cleanup_common(struct obd_device *obd)
 
        /* free memory of osc quota cache */
        osc_quota_cleanup(obd);
-
-       rc = client_obd_cleanup(obd);
-
+       client_obd_cleanup(obd);
        ptlrpcd_decref();
-       RETURN(rc);
+       RETURN(0);
 }
 EXPORT_SYMBOL(osc_cleanup_common);
 
index 8f39d87..4c9cbbc 100644 (file)
@@ -369,9 +369,9 @@ static struct lu_device *lwp_device_alloc(const struct lu_env *env,
 static struct lu_device *lwp_device_fini(const struct lu_env *env,
                                         struct lu_device *ludev)
 {
-       struct lwp_device       *m = lu2lwp_dev(ludev);
-       struct task_struct      *task = NULL;
-       int                      rc;
+       struct lwp_device *m = lu2lwp_dev(ludev);
+       struct task_struct *task = NULL;
+
        ENTRY;
 
        task = xchg(&m->lpd_notify_task, NULL);
@@ -384,13 +384,9 @@ static struct lu_device *lwp_device_fini(const struct lu_env *env,
                class_disconnect(m->lpd_exp);
 
        LASSERT(m->lpd_obd);
-       rc = client_obd_cleanup(m->lpd_obd);
-       LASSERTF(rc == 0, "error %d\n", rc);
-
+       client_obd_cleanup(m->lpd_obd);
        ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
-
        ptlrpcd_decref();
-
        RETURN(NULL);
 }
 
index 177f110..156ca64 100644 (file)
@@ -1370,7 +1370,6 @@ static struct lu_device *osp_device_fini(const struct lu_env *env,
                                         struct lu_device *ld)
 {
        struct osp_device *osp = lu2osp_dev(ld);
-       int                rc;
 
        ENTRY;
 
@@ -1392,10 +1391,9 @@ static struct lu_device *osp_device_fini(const struct lu_env *env,
         * the obd devices are already gone.
         */
        osp_tunables_fini(osp);
-       rc = client_obd_cleanup(osp->opd_obd);
+       client_obd_cleanup(osp->opd_obd);
        ptlrpcd_decref();
-
-       RETURN(rc != 0 ? ERR_PTR(rc) : NULL);
+       RETURN(NULL);
 }
 
 /**