From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: md:When opened /proc/mdstat, increase the refcount of
Date: Sun, 26 Feb 2012 22:01:20 +1100 [thread overview]
Message-ID: <20120226220120.3dbe3a3b@notabene.brown> (raw)
In-Reply-To: <201202261633221401738@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]
On Sun, 26 Feb 2012 16:33:25 +0800 "majianpeng" <majianpeng@gmail.com> wrote:
> I wrote a letter to maintainer of procfs. He's answer is follow:
> >No. Read remove_proc_entry(), especially the part under ->pde_unload_lock.
> >The whole damn point of that stuff is that opened file on procfs does *not*
> >pin the module down; IO in progress does, but that's it.
> >You can't deadlock rmmod foobar </proc/crap/foobar; with your patch we'll
> >be back to a pile of deadlocks in there.
> >IOW, NAK.
Hmmm... that sounds like Al Viro.
I see the point of that code now. And your patch would be open to the same
problem wouldn't it. i.e.
rmmod md_mod < /proc/mdstat
would deadlock??
So we still need to find a fix that actually works correctly.
That probably means moving the call to 'poll_wait' into procfs code, and using
a wait_queue_head which is managed by procfs.
So maybe:
- put a wait_queue_head in 'struct proc_dir_entry'
- have proc_reg_poll call poll_wait passing that wait_queue_head
- write a function e.g. proc_poll_wake which calls wake_up on that
wait_queue_head
- have md.c save the return value from proc_create, and call the above
function instead of calling "wake_up(&md_event_waiters)"
That should work.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-02-26 11:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-26 4:55 md:When opened /proc/mdstat, increase the refcount of majianpeng
2012-02-26 5:26 ` NeilBrown
2012-02-26 5:39 ` majianpeng
2012-02-26 8:36 ` NeilBrown
2012-02-26 8:33 ` majianpeng
2012-02-26 11:01 ` NeilBrown [this message]
2012-02-27 1:21 ` majianpeng
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=20120226220120.3dbe3a3b@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=majianpeng@gmail.com \
/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).