From: David Woodhouse <dwmw2@infradead.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, markmc@redhat.com
Subject: Re: tun: add tun_flags, owner, group attributes in sysfs
Date: Sat, 09 May 2009 23:55:45 +0100 [thread overview]
Message-ID: <1241909745.24436.49.camel@macbook.infradead.org> (raw)
In-Reply-To: <1241908073.24436.27.camel@macbook.infradead.org>
On Sat, 2009-05-09 at 23:27 +0100, David Woodhouse wrote:
> On Sat, 2009-05-09 at 13:27 -0700, David Miller wrote:
> > From: David Woodhouse <dwmw2@infradead.org>
> > Date: Mon, 04 May 2009 11:32:16 +0100
> >
> > > I don't have to explicitly remove the files, do I? They go away
> > > naturally when the device is unregistered?
> >
> > I'm not so sure about this. I can't see anything in the
> > drivers/base/core.c code that automatically deletes anything
> > other than device groups and attributes.
>
> Hm, I really do think the attributes go away automatically when the
> parent device does.
>
> If not, gianfar_sysfs.c and niu.c want fixing too -- and we should
> probably have a WARN_ON() in the sysfs code when it happens, if
> possible.
>
> I'll experiment (since I'm getting lost when I try to work it out by
> inspection).
I added a WARN_ON(!strcmp(sd->s_name, "tun_flags")) into
release_sysfs_dirent() to see when (and if) it gets called.
It does.
Looking at the backtrace, I see it's __sysfs_remove_dir() which iterates
over all the children of the device's directory and kills them:
[ 98.024138] [<ffffffff810f2e4e>] release_sysfs_dirent+0x49/0xc8
[ 98.030178] [<ffffffff810f2eff>] __sysfs_put+0x32/0x36
[ 98.035432] [<ffffffff810f3133>] sysfs_addrm_finish+0x20c/0x239
[ 98.041470] [<ffffffff810f2870>] ? sysfs_ilookup_test+0x0/0x14
[ 98.047417] [<ffffffff810f3214>] sysfs_remove_dir+0x6f/0x82
[ 98.053107] [<ffffffff8118fce4>] kobject_del+0x16/0x37
[ 98.058367] [<ffffffff8123953f>] device_del+0x16b/0x17b
[ 98.063769] [<ffffffff813b2d8f>] netdev_unregister_kobject+0x24/0x29
[ 98.070241] [<ffffffff813a7f0f>] rollback_registered+0x1d2/0x1e3
[ 98.076364] [<ffffffff813a7f5a>] unregister_netdevice+0x3a/0x69
[ 98.082402] [<ffffffffa0006458>] tun_chr_close+0x3d/0x66 [tun]
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
next prev parent reply other threads:[~2009-05-09 22:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-04 10:32 tun: add tun_flags, owner, group attributes in sysfs David Woodhouse
2009-05-04 10:36 ` Michael Tokarev
2009-05-05 22:18 ` David Woodhouse
2009-05-04 10:42 ` [iproute2 patch]: Add 'ip tuntap' facility for managing tun/tap devices David Woodhouse
2009-05-04 14:38 ` Stephen Hemminger
2009-05-04 14:49 ` David Woodhouse
2009-05-27 16:32 ` David Woodhouse
2009-05-27 16:38 ` Stephen Hemminger
2009-05-27 16:49 ` David Woodhouse
2009-05-27 17:06 ` Stephen Hemminger
2009-05-27 20:44 ` David Miller
2009-05-27 20:43 ` David Miller
2009-05-28 4:58 ` Stephen Hemminger
2009-05-28 8:12 ` David Woodhouse
2009-06-13 8:55 ` David Woodhouse
2009-07-20 23:44 ` David Woodhouse
2009-05-04 14:47 ` tun: add tun_flags, owner, group attributes in sysfs Stephen Hemminger
2009-05-04 14:58 ` David Woodhouse
2009-05-09 20:27 ` David Miller
2009-05-09 22:27 ` David Woodhouse
2009-05-09 22:55 ` David Woodhouse [this message]
2009-05-09 22:56 ` David Miller
2009-05-10 5:54 ` David 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=1241909745.24436.49.camel@macbook.infradead.org \
--to=dwmw2@infradead.org \
--cc=davem@davemloft.net \
--cc=markmc@redhat.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).