[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e7530fc-c546-4420-9ca7-0e3d0a7b63e5@linux.dev>
Date: Wed, 15 Oct 2025 14:03:55 +0800
From: luoxuanqiang <xuanqiang.luo@...ux.dev>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
eric.dumazet@...il.com, Kuniyuki Iwashima <kuniyu@...gle.com>
Subject: Re: [PATCH net-next] net: remove obsolete
WARN_ON(refcount_read(&sk->sk_refcnt) == 1)
在 2025/10/14 22:06, Eric Dumazet 写道:
> sk->sk_refcnt has been converted to refcount_t in 2017.
>
> __sock_put(sk) being refcount_dec(&sk->sk_refcnt), it will complain
> loudly if the current refcnt is 1 (or less) in a non racy way.
>
> We can remove four WARN_ON() in favor of the generic refcount_dec()
> check.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Reviewed-by: Xuanqiang Luo<luoxuanqiang@...inos.cn>
Dear Eric,
Following your line of thought, I found there's also a point in btrfs that
needs modification.
Would you like to modify it together? Though it has nothing to do with
socket, or shall I modify it separately later?
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 89ae0c7a610a..485bef0ba419 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -138,7 +138,6 @@ static const unsigned int btrfs_blocked_trans_types[TRANS_STATE_MAX] = {
void btrfs_put_transaction(struct btrfs_transaction *transaction)
{
- WARN_ON(refcount_read(&transaction->use_count) == 0);
if (refcount_dec_and_test(&transaction->use_count)) {
BUG_ON(!list_empty(&transaction->list));
WARN_ON(!xa_empty(&transaction->delayed_refs.head_refs));
Thanks!
Powered by blists - more mailing lists