public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH v5 2/4] batman-adv: Modify mesh_iface outside sysfs context
Date: Mon, 20 Jun 2016 16:36:47 +0800	[thread overview]
Message-ID: <18352303.nIKADFaKRH@voltaire> (raw)
In-Reply-To: <1465796492-5039-2-git-send-email-sven@narfation.org>

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Monday, June 13, 2016 07:41:30 Sven Eckelmann wrote:
> The legacy sysfs interface to modify interfaces belonging to batman-adv
> is run inside a region holding s_lock. And to add a net_device, it has
> to also get the rtnl_lock. This is exactly the other way around than in
> other virtual net_devices and conflicts with netdevice notifier which
> executes inside rtnl_lock.
> 
> The inverted lock situation is currently solved by executing the removal
> of netdevices via workqueue. The workqueue isn't executed inside
> rtnl_lock and thus can independently get the s_lock and the rtnl_lock.
> 
> But this workaround fails when the netdevice notifier creates events in
> quick succession and the earlier triggered removal of a net_device isn't
> processed in the workqueue before the adding of the new netdevice (with
> same name) event is issued.
> 
> Instead the legacy sysfs interface store events have to be enqueued in
> a workqueue to loose the s_lock. The worker is then free to get the
> required locks and the deadlock is avoided.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v5:
>  - rebase on top of current master
> v4:
>  - rebase on top of current master
> v3:
>  - rebased on top of current master to fix conflicts with newest patches
> v2:
>  - rebased on top of current master to fix conflicts with newest patches
> ---
>  net/batman-adv/sysfs.c | 107
> +++++++++++++++++++++++++++++++++++++------------ net/batman-adv/types.h
> |  13 ++++++
>  2 files changed, 94 insertions(+), 26 deletions(-)

Applied in revision a1f0a80.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2016-06-20  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  5:41 [B.A.T.M.A.N.] [PATCH v5 1/4] Revert "batman-adv: Fix hardif remove/add race" Sven Eckelmann
2016-06-13  5:41 ` [B.A.T.M.A.N.] [PATCH v5 2/4] batman-adv: Modify mesh_iface outside sysfs context Sven Eckelmann
2016-06-20  8:36   ` Marek Lindner [this message]
2016-06-13  5:41 ` [B.A.T.M.A.N.] [PATCH v5 3/4] batman-adv: Revert "postpone sysfs removal when unregistering" Sven Eckelmann
2016-06-20  8:37   ` Marek Lindner
2016-06-13  5:41 ` [B.A.T.M.A.N.] [PATCH v5 4/4] batman-adv: Avoid sysfs name collision for netns moves Sven Eckelmann
2016-06-20  8:37   ` Marek Lindner
2016-06-20  8:36 ` [B.A.T.M.A.N.] [PATCH v5 1/4] Revert "batman-adv: Fix hardif remove/add race" Marek Lindner

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=18352303.nIKADFaKRH@voltaire \
    --to=mareklindner@neomailbox.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.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