All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: kaber@trash.net, netdev@oss.sgi.com
Subject: Re: [PATCH] PKT_SCHED: Fix double locking in tcindex destroy path
Date: Mon, 20 Dec 2004 15:36:24 -0800	[thread overview]
Message-ID: <20041220153624.58a1d93e.davem@davemloft.net> (raw)
In-Reply-To: <20041210124445.GV1371@postel.suug.ch>

On Fri, 10 Dec 2004 13:44:45 +0100
Thomas Graf <tgraf@suug.ch> wrote:

> * Patrick McHardy <41B90B81.1020102@trash.net> 2004-12-10 03:35
> > Thomas Graf wrote:
> > 
> > >tcindex's destroy uses its own delete functions to destroy its
> > >configuration. The delete function (correctly) takes the qdisc_tree_lock
> > >to prevent list walkings from happening while removing from the list.
> > >The qdisc_tree_lock is already held if we're comming via the destroy
> > >path and thus a double locking takes place.
> > >
> > >Patch not needed for 2.4 since both destroy paths are unlocked but will
> > >be needed if we add them.
> > > 
> > >
> > Looks correct, but 2.4 does need this. qdisc_destroy in 2.4 always
> > happens under dev->queue_lock. For example dev_shutdown from 2.4:
> 
> Not 100% correct since cls_api.c drops the lock before calling
> tcf_destroy but the patch is indeed needed and it's not a problem
> if dev->queue_lock is not taken since it is already unlinked as you
> correctly stated in your previous mail. Thanks Patrick.
> 
> Patch also applies to 2.4 with some fuzz.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

I think the conditional locking is quite ugly, but I can't
suggest something better at this time.

Patch applied to both 2.4.x and 2.6.x, thanks Patrick
and Thomas.

      reply	other threads:[~2004-12-20 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-10  1:49 [PATCH] PKT_SCHED: Fix double locking in tcindex destroy path Thomas Graf
2004-12-10  2:35 ` Patrick McHardy
2004-12-10 12:44   ` Thomas Graf
2004-12-20 23:36     ` David S. Miller [this message]

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=20041220153624.58a1d93e.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.