From: Dominique Martinet <asmadeus@codewreck.org>
To: piaojun <piaojun@huawei.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Eric Van Hensbergen <ericvh@gmail.com>,
Ron Minnich <rminnich@sandia.gov>,
Latchesar Ionkov <lucho@ionkov.net>, Greg Kurz <groug@kaod.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
v9fs-developer@lists.sourceforge.net
Subject: Re: [PATCH] net/9p/trans_virtio.c: decrease the refcount of 9p virtio device when removing it
Date: Wed, 8 Aug 2018 10:36:30 +0200 [thread overview]
Message-ID: <20180808083630.GB16121@nautica> (raw)
In-Reply-To: <5B6AA65E.3030907@huawei.com>
piaojun wrote on Wed, Aug 08, 2018:
> I found that 9pnet_virtio.ko could not be removed by rmmod command, and I
> could still found it by lsmod. The reason is that we forgot decrease the
> refcount of 9p virtio device by kobject_put. So we should put refcount in
> p9_virtio_remove.
Hmm, I cannot seem to reproduce this. Can you give more details on how
to get into stuck state?
I tried mounting something, accessing the sysfs files, etc to no avail.
lsmod gives a counter to how many references there are to the module,
you can use that to debug a bit.
For example here I get this line just after loading the module:
9pnet_virtio 32768 0
Then after mounting something there is one reference:
9pnet_virtio 32768 1
Then unmounting puts that back to 0 and 'modprobe -r' (or rmmod) works.
I dislike saying the next part but I think form also is important,
please bear with me:
- shorter subject line, please. For example, you can lose 20 characters
by reodering words so there is no need for pronouns
"net/9p/virtio: decrease 9p virtio device refcount on removal"
- I personally dislike commit messages that are "novelized" (that is,
put yourself as an actor and describe what you were doing)
That seems to be somewhat accepted as looking at the kernel's git log I
see some (few) commits using "I ..." that are not pull request messages
but if possible please avoid this style and try to describe facts, how
things are wrong, what got fixed and if required how.
To give an example again, this says the same thing:
"The 9pnet_virtio module could not be unloaded because we forgot to
decrease the refcount of the 9p virtio device with kobject_put.
Put the reference in 9p_virtio_remove"
Thanks,
--
Dominique
next prev parent reply other threads:[~2018-08-08 8:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 8:14 piaojun
2018-08-08 8:36 ` Dominique Martinet [this message]
2018-08-08 8:57 ` piaojun
2018-08-08 9:40 ` Dominique Martinet
2018-08-09 0:45 ` piaojun
2018-08-09 1:18 ` Dominique Martinet
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=20180808083630.GB16121@nautica \
--to=asmadeus@codewreck.org \
--cc=akpm@linux-foundation.org \
--cc=ericvh@gmail.com \
--cc=groug@kaod.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=piaojun@huawei.com \
--cc=rminnich@sandia.gov \
--cc=v9fs-developer@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®