From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: amwang@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [Patch] net: fix incorrect counting in __scm_destroy()
Date: Wed, 04 Nov 2009 04:41:16 -0800 (PST) [thread overview]
Message-ID: <20091104.044116.37320720.davem@davemloft.net> (raw)
In-Reply-To: <4AF15771.8060204@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 04 Nov 2009 11:29:05 +0100
> Given we kfree(fpl) at the end of loop, we cannot recursively call
> __scm_destroy() on same fpl, it would be a bug anyway ?
>
> So you probably need something better, like testing fpl->list being
> not re-included in current->scm_work_list before kfree() it
I can't even see what the problem is.
The code is designed such that the ->count only matters for
the top level.
If we recursively fput() and get back here, we'll see that
there is someone higher in the call chain already running
the fput() loop and we'll just list_add_tail().
The inner while() loop will make sure we process such
entries once we get back to the top level and exit the
for() loop.
Amerigo, please show us the problematic code path where the counts go
wrong and this causes problems.
Thanks.
next prev parent reply other threads:[~2009-11-04 12:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 10:04 [Patch] net: fix incorrect counting in __scm_destroy() Amerigo Wang
2009-11-04 10:29 ` Eric Dumazet
2009-11-04 12:41 ` David Miller [this message]
2009-11-10 6:12 ` Cong Wang
2009-11-10 6:33 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091104.044116.37320720.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=amwang@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).