LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: David Howells <dhowells@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jarek Poplawski <jarkao2@o2.pl>,
	"David S. Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] net/bridge/br_if.c: don't use _WORK_NAR
Date: Mon, 19 Feb 2007 17:56:13 +0300	[thread overview]
Message-ID: <20070219145613.GB75@tv-sign.ru> (raw)
In-Reply-To: <15331.1171890900@redhat.com>

On 02/19, David Howells wrote:
>
> Hmmm...  You've got a work_struct (well, a delayed_work actually) - can you
> just punt the destruction of the object over to keventd to perform, I wonder?

Yes, this is close (I think) to what I suggested, see below,

> The big problem with that that I see is that the workqueue facility has no
> guards in place against a work_struct's handler function running on several
> CPUs at once in response to the same work_struct.

Yes. And for this problem WORK_STRUCT_NOAUTOREL does help, but not so much.
It can prevent re-scheduling of the same work, but only if work->func() did
not do work_release() yet.

> > I think the fix should be so that port_carrier_check() does get/put on
> > "struct net_bridge_port" (container), but not on "struct net_device", and
> 
> I'm not sure how this helps.  You still have to get rid of the net_device at
> some point.

Yes, destroy_nbp() does dev_put(dev). del_nbp() sets dev->br_port = NULL,
port_carrier_check() goes to "done" in that case. So everething looks safe
to me (but again, I do not even know what the "bridge" is :), so we should
only take care about container, nothing more.

I'll try to make a patch for illustration on evening.

Oleg.


  reply	other threads:[~2007-02-19 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 21:43 Oleg Nesterov
2007-02-19 11:00 ` Jarek Poplawski
2007-02-19 12:03   ` Oleg Nesterov
2007-02-19 13:27     ` Jarek Poplawski
2007-02-19 15:04       ` Oleg Nesterov
2007-02-20 13:25         ` Jarek Poplawski
2007-02-20 14:25           ` Oleg Nesterov
2007-02-19 11:27 ` David Howells
2007-02-19 11:59   ` Oleg Nesterov
2007-02-19 22:11     ` PATCH? net/bridge/br_if.c: fix use after free in port_carrier_check() Oleg Nesterov
2007-02-20 10:44     ` David Howells
2007-02-20 14:34       ` Oleg Nesterov
2007-02-19 13:15   ` [PATCH 1/3] net/bridge/br_if.c: don't use _WORK_NAR David Howells
2007-02-19 14:56     ` Oleg Nesterov [this message]
2007-02-19 15:15     ` David Howells

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=20070219145613.GB75@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=jarkao2@o2.pl \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/3] net/bridge/br_if.c: don'\''t use _WORK_NAR' \
    /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

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).