[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78709d5e.49a9.17ab54fead8.Coremail.xiyuyang19@fudan.edu.cn>
Date: Sun, 18 Jul 2021 00:32:31 +0800 (GMT+08:00)
From: "Xiyu Yang" <xiyuyang19@...an.edu.cn>
To: "Trond Myklebust" <trondmy@...merspace.com>
Cc: "tanxin.ctf@...il.com" <tanxin.ctf@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"chuck.lever@...cle.com" <chuck.lever@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kolga@...app.com" <kolga@...app.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bfields@...ldses.org" <bfields@...ldses.org>,
"anna.schumaker@...app.com" <anna.schumaker@...app.com>,
"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
"yuanxzhang@...an.edu.cn" <yuanxzhang@...an.edu.cn>
Subject: Re: Re: [PATCH] SUNRPC: Convert from atomic_t to refcount_t on
rpc_clnt->cl_count
Sorry, I'm not sure why you need to bump a zero refcount in a normal situation. But maybe we can use refcount_inc_not_zero() API in rpc_free_auth() instead?
> -----Original Messages-----
> From: "Trond Myklebust" <trondmy@...merspace.com>
> Sent Time: 2021-07-17 22:43:26 (Saturday)
> To: "tanxin.ctf@...il.com" <tanxin.ctf@...il.com>, "xiyuyang19@...an.edu.cn" <xiyuyang19@...an.edu.cn>, "davem@...emloft.net" <davem@...emloft.net>, "chuck.lever@...cle.com" <chuck.lever@...cle.com>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "kolga@...app.com" <kolga@...app.com>, "kuba@...nel.org" <kuba@...nel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "bfields@...ldses.org" <bfields@...ldses.org>, "anna.schumaker@...app.com" <anna.schumaker@...app.com>, "linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>
> Cc: "yuanxzhang@...an.edu.cn" <yuanxzhang@...an.edu.cn>
> Subject: Re: [PATCH] SUNRPC: Convert from atomic_t to refcount_t on rpc_clnt->cl_count
>
> On Sat, 2021-07-17 at 18:18 +0800, Xiyu Yang wrote:
> > refcount_t type and corresponding API can protect refcounters from
> > accidental underflow and overflow and further use-after-free
> > situations.
> >
>
> Have you tested this patch? As far as I remember, the reason why we
> never converted is that refcount_inc() gets upset and WARNs when you
> bump a zero refcount, like we do very much on purpose in
> rpc_free_auth(). Is that no longer the case?
>
>
> --
> Trond Myklebust
> Linux NFS client maintainer, Hammerspace
> trond.myklebust@...merspace.com
>
>
Powered by blists - more mailing lists