exit: Rename module_put_and_exit to module_put_and_kthread_exit
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Dec 2021 17:00:19 +0000 (11:00 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 13 Dec 2021 18:04:45 +0000 (12:04 -0600)
Update module_put_and_exit to call kthread_exit instead of do_exit.

Change the name to reflect this change in functionality.  All of the
users of module_put_and_exit are causing the current kthread to exit
so this change makes it clear what is happening.  There is no
functional change.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
crypto/algboss.c
fs/cifs/connect.c
fs/nfs/callback.c
fs/nfs/nfs4state.c
fs/nfsd/nfssvc.c
include/linux/module.h
kernel/module.c
net/bluetooth/bnep/core.c
net/bluetooth/cmtp/core.c
net/bluetooth/hidp/core.c
tools/objtool/check.c

index 1814d2c5188a31ef1db46f6ea5e1cbfc1f303f27..eb5fe84efb83e69cba4335f896b6a8f740630de2 100644 (file)
@@ -67,7 +67,7 @@ out:
        complete_all(&param->larval->completion);
        crypto_alg_put(&param->larval->alg);
        kfree(param);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 static int cryptomgr_schedule_probe(struct crypto_larval *larval)
@@ -190,7 +190,7 @@ skiptest:
        crypto_alg_tested(param->driver, err);
 
        kfree(param);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 static int cryptomgr_schedule_test(struct crypto_alg *alg)
index 82577a7a5bb147101d248c334de5d93220ce4ad3..39fbe9acbf51abb8e34399b24d8bdc644cc73a55 100644 (file)
@@ -1139,7 +1139,7 @@ next_pdu:
        }
 
        memalloc_noreclaim_restore(noreclaim_flag);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 /*
index 86d856de1389b18583f5db9842be133c6a19a6a0..3c86a559a321ae6e006f66957220e51a82d52f64 100644 (file)
@@ -93,7 +93,7 @@ nfs4_callback_svc(void *vrqstp)
                svc_process(rqstp);
        }
        svc_exit_thread(rqstp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
@@ -137,7 +137,7 @@ nfs41_callback_svc(void *vrqstp)
                }
        }
        svc_exit_thread(rqstp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index ecc4594299d6fef16bdb4140fa7ef99acecab7f3..ea41af7319782027948f994b7a0c4a262f4c1914 100644 (file)
@@ -2689,6 +2689,6 @@ static int nfs4_run_state_manager(void *ptr)
        allow_signal(SIGKILL);
        nfs4_state_manager(clp);
        nfs_put_client(clp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
index 80431921e5d79932127502b6feb1ab7f626e11e7..5ce9f14318c4ec9e294eb46f1c922b358393bba7 100644 (file)
@@ -986,7 +986,7 @@ out:
 
        /* Release module */
        mutex_unlock(&nfsd_mutex);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index c9f1200b23121a4199ca9fad1d97ce0d6a6c84ad..f03be97e9ec16184276182efb8ec192691d4337f 100644 (file)
@@ -595,9 +595,9 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 /* Look for this name: can be of form module:name. */
 unsigned long module_kallsyms_lookup_name(const char *name);
 
-extern void __noreturn __module_put_and_exit(struct module *mod,
+extern void __noreturn __module_put_and_kthread_exit(struct module *mod,
                        long code);
-#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
+#define module_put_and_kthread_exit(code) __module_put_and_kthread_exit(THIS_MODULE, code)
 
 #ifdef CONFIG_MODULE_UNLOAD
 int module_refcount(struct module *mod);
@@ -790,7 +790,7 @@ static inline int unregister_module_notifier(struct notifier_block *nb)
        return 0;
 }
 
-#define module_put_and_exit(code) do_exit(code)
+#define module_put_and_kthread_exit(code) kthread_exit(code)
 
 static inline void print_modules(void)
 {
index 84a9141a5e159a01642c6a67e4250e016de39797..a3aa00bf270de14fa1f16b86d8e27f7ab5cea048 100644 (file)
@@ -337,12 +337,12 @@ static inline void add_taint_module(struct module *mod, unsigned flag,
  * A thread that wants to hold a reference to a module only while it
  * is running can call this to safely exit.  nfsd and lockd use this.
  */
-void __noreturn __module_put_and_exit(struct module *mod, long code)
+void __noreturn __module_put_and_kthread_exit(struct module *mod, long code)
 {
        module_put(mod);
-       do_exit(code);
+       kthread_exit(code);
 }
-EXPORT_SYMBOL(__module_put_and_exit);
+EXPORT_SYMBOL(__module_put_and_kthread_exit);
 
 /* Find a module section: 0 means not found. */
 static unsigned int find_sec(const struct load_info *info, const char *name)
index c9add7753b9f236c552feaea76f407ad97cb85fd..40baa6b7321ae4714337721b61a489a4eaf35b1a 100644 (file)
@@ -535,7 +535,7 @@ static int bnep_session(void *arg)
 
        up_write(&bnep_session_sem);
        free_netdev(dev);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 0a2d78e811cf5bbea7d735bc345a1ddc9a46cbf8..9bfded6b74b3f5335d770d3681e10d203fc38647 100644 (file)
@@ -323,7 +323,7 @@ static int cmtp_session(void *arg)
        up_write(&cmtp_session_sem);
 
        kfree(session);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 80848dfc01db57528d9e559868e41d53873213e8..5940744a8cd8b682ed6d4e013778dbba1d17ec65 100644 (file)
@@ -1305,7 +1305,7 @@ static int hidp_session_thread(void *arg)
        l2cap_unregister_user(session->conn, &session->user);
        hidp_session_put(session);
 
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 90108fe5610d00eefd3adccd6921ad82356f7a14..120e9598c11a5478def595c0b757c1ba989efec1 100644 (file)
@@ -170,7 +170,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "do_task_dead",
                "kthread_exit",
                "make_task_dead",
-               "__module_put_and_exit",
+               "__module_put_and_kthread_exit",
                "complete_and_exit",
                "__reiserfs_panic",
                "lbug_with_loc",