All of lore.kernel.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 4/4] batman-adv: Avoid sysfs name collision for netns moves
Date: Mon, 20 Jun 2016 16:37:41 +0800	[thread overview]
Message-ID: <5935107.moVPDjaayx@voltaire> (raw)
In-Reply-To: <1465796492-5039-4-git-send-email-sven@narfation.org>

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

On Monday, June 13, 2016 07:41:32 Sven Eckelmann wrote:
> The kobject_put is only removing the sysfs entry and corresponding entries
> when its reference counter becomes zero. This tends to lead to collisions
> when a device is moved between two different network namespaces because
> some of the sysfs files have to be removed first and then added again to
> the already moved sysfs entry.
> 
>     WARNING: CPU: 0 PID: 290 at lib/kobject.c:240
> kobject_add_internal+0x5ec/0x8a0 kobject_add_internal failed for batman_adv
> with -EEXIST, don't try to register things with the same name in the same
> directory.
> 
> But the caller of kobject_put can already remove the sysfs entry before it
> does the kobject_put. This removal is done even when the reference counter
> is not yet zero and thus avoids the problem.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v5:
>  - rebase on top of current master
> v4:
>  - rebase on top of current master
>  - avoid deletes of vlan->kobj when it is a pointer to bat_priv->mesh_obj
>    (happens for untagged vlan and can cause some kernfs warnings)
> 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 | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

Applied in revision bebf178.

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:37 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
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 [this message]
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=5935107.moVPDjaayx@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 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.