[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67b00a33-155b-03b8-cb74-7d0095187ca9@linux.alibaba.com>
Date: Fri, 6 May 2022 14:47:35 +0800
From: "D. Wythe" <alibuda@...ux.alibaba.com>
To: kgraul@...ux.ibm.com
Cc: kuba@...nel.org, davem@...emloft.net, netdev@...r.kernel.org,
linux-s390@...r.kernel.org, linux-rdma@...r.kernel.org
Subject: Re: [PATCH net-next] net/smc: Fix smc-r link reference count
在 2022/5/6 下午1:22, D. Wythe 写道:
> From: "D. Wythe" <alibuda@...ux.alibaba.com>
>
> The following scenarios exist:
>
> lnk->refcnt=1;
> smcr_link_put(lnk);
> lnk->refcnt=0;
> smcr_link_hold(lnk);
> __smcr_link_clear(lnk);
> do_xxx(lnk);
>
> This patch try using refcount_inc_not_zero() instead refcount_inc()
> to prevent this race condition. Therefore, we need to always check its
> return value, and respond with an error when it fails.
>
> Fixes: 20c9398d3309 ("net/smc: Resolve the race between SMC-R link access and clear")
> Signed-off-by: D. Wythe <alibuda@...ux.alibaba.com>
Wrong subject prefix here, please ignore this patch, we will send
another revison later.
Thanks.
D. Wythe
Powered by blists - more mailing lists