Linux bluetooth development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: linux-bluetooth@vger.kernel.org, kernel@pengutronix.de,
	mcr@sandelman.ca, lukasz.duda@nordicsemi.no,
	martin.gergeleit@hs-rm.de
Subject: Re: [RFC bluetooth-next 1/4] 6lowpan: add debugfs support
Date: Thu, 12 Nov 2015 18:04:35 +0100	[thread overview]
Message-ID: <20151112170430.GA884@omega> (raw)
In-Reply-To: <1447262079-2509-2-git-send-email-alex.aring@gmail.com>

On Wed, Nov 11, 2015 at 06:14:36PM +0100, Alexander Aring wrote:
...
> +config 6LOWPAN_DEBUGFS
> +	bool "6LoWPAN debugfs support"
> +	depends on 6LOWPAN

missing:

depends on DEBUG_FS

> +	---help---
> +	  This enables 6LoWPAN debugfs support. For example to manipulate
> +	  IPHC context information at runtime.
> +
>  menuconfig 6LOWPAN_NHC
>  	tristate "Next Header Compression Support"
>  	depends on 6LOWPAN
> diff --git a/net/6lowpan/Makefile b/net/6lowpan/Makefile
> index c6ffc55..54cad8d 100644
> --- a/net/6lowpan/Makefile
> +++ b/net/6lowpan/Makefile
> @@ -1,6 +1,7 @@
>  obj-$(CONFIG_6LOWPAN) += 6lowpan.o
>  
>  6lowpan-y := core.o iphc.o nhc.o
> +6lowpan-$(CONFIG_6LOWPAN_DEBUGFS) += debugfs.o
...
> +
> +int lowpan_dev_debugfs_init(struct net_device *dev)
> +{
> +	static struct dentry *iface;
> +
> +	/* creating the root */
> +	iface = debugfs_create_dir(dev->name, lowpan_debugfs);
> +	if (!iface)
> +		goto fail;
> +
> +	return 0;
> +
> +fail:
> +	lowpan_debugfs_exit();

This is broken, this will delete everything also the
"$DEBUGFS_MOUNTPOINT/6lowpan" directory. What we need is a
debugfs_remove_recursive(iface); call here, which deletes everything
which is registered at iface dentry.

Also we need to call this when a lowpan interface will be unregistered,
otherwise we have still the debugfs entries when an interface doesn't
exist anymore.

I will fix this issues for the next try.

- Alex

  reply	other threads:[~2015-11-12 17:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 17:14 [RFC bluetooth-next 0/4] 6lowpan: debugfs and stateful compression support Alexander Aring
2015-11-11 17:14 ` [RFC bluetooth-next 1/4] 6lowpan: add debugfs support Alexander Aring
2015-11-12 17:04   ` Alexander Aring [this message]
2015-11-11 17:14 ` [RFC bluetooth-next 2/4] 6lowpan: iphc: add check for reserved values Alexander Aring
2015-11-11 17:14 ` [RFC bluetooth-next 3/4] 6lowpan: iphc: remove handling when dam is zero Alexander Aring
2015-11-11 17:14 ` [RFC bluetooth-next 4/4] 6lowpan: iphc: add support for stateful compression Alexander Aring
2015-11-13 18:08   ` Michael Richardson
2015-11-14  9:20     ` Alexander Aring

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=20151112170430.GA884@omega \
    --to=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=lukasz.duda@nordicsemi.no \
    --cc=martin.gergeleit@hs-rm.de \
    --cc=mcr@sandelman.ca \
    /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