lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <36250e331421cddb10fbb1ca38df72aad812e3a3.camel@hammerspace.com>
Date:   Thu, 21 Oct 2021 13:16:48 +0000
From:   Trond Myklebust <trondmy@...merspace.com>
To:     "caihuoqing@...du.com" <caihuoqing@...du.com>
CC:     "bfields@...ldses.org" <bfields@...ldses.org>,
        "linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
        "anna.schumaker@...app.com" <anna.schumaker@...app.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "chuck.lever@...cle.com" <chuck.lever@...cle.com>
Subject: Re: [PATCH] SUNRPC: Make use of the helper macro kthread_run()

On Thu, 2021-10-21 at 16:43 +0800, Cai Huoqing wrote:
> [You don't often get email from caihuoqing@...du.com. Learn why this
> is important at http://aka.ms/LearnAboutSenderIdentification.]
> 
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
> 
> Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
> ---
>  fs/lockd/svc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index b220e1b91726..934dc13a7011 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -397,7 +397,7 @@ static int lockd_start_svc(struct svc_serv *serv)
>         svc_sock_update_bufs(serv);
>         serv->sv_maxconn = nlm_max_connections;
> 
> -       nlmsvc_task = kthread_create(lockd, nlmsvc_rqst, "%s", serv-
> >sv_name);
> +       nlmsvc_task = kthread_run(lockd, nlmsvc_rqst, "%s", serv-
> >sv_name);
>         if (IS_ERR(nlmsvc_task)) {
>                 error = PTR_ERR(nlmsvc_task);
>                 printk(KERN_WARNING
> @@ -405,7 +405,6 @@ static int lockd_start_svc(struct svc_serv *serv)
>                 goto out_task;
>         }
>         nlmsvc_rqst->rq_task = nlmsvc_task;
> -       wake_up_process(nlmsvc_task);

No. That would mean nlmsvc_rqst->rq_task would be uninitialised when
the thread starts. Please try to understand the code before proposing
changes.

> 
>         dprintk("lockd_up: service started\n");
>         return 0;
> --
> 2.25.1
> 

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@...merspace.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ