All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@oss.sgi.com
Subject: Re: [PATCH] PKT_SCHED: Fix double locking in tcindex destroy path
Date: Fri, 10 Dec 2004 03:35:45 +0100	[thread overview]
Message-ID: <41B90B81.1020102@trash.net> (raw)
In-Reply-To: <20041210014918.GT1371@postel.suug.ch>

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:

        write_lock(&qdisc_tree_lock);
        spin_lock_bh(&dev->queue_lock);
...
        qdisc_destroy(qdisc);

But please rename "already_locked" to "lock" to make it look less like
a hack to avoid deadlock.

>+	return __tcindex_delete(tp,arg, 1);
>  
>
And a space is missing :)

Regards
Patrick

  reply	other threads:[~2004-12-10  2:35 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 [this message]
2004-12-10 12:44   ` Thomas Graf
2004-12-20 23:36     ` David S. Miller

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=41B90B81.1020102@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.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.