All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: proc:Add a reference of module when proc_reg_file opened
Date: Sun, 26 Feb 2012 07:50:25 +0000	[thread overview]
Message-ID: <20120226075025.GC23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <201202261434450622160@gmail.com>

On Sun, Feb 26, 2012 at 02:34:48PM +0800, majianpeng wrote:
> >From 49b46362bf3221a259bfc73105ad041376b66878 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Sun, 26 Feb 2012 22:19:51 +0800
> Subject: [PATCH] proc:Add a reference of module when proc_reg_file opened.
> 
> If struct file_operations of a regular file in procfs defined in module
> and defined .owner = THIS_MODULE,open this file must get a reference of
> module.

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.

      reply	other threads:[~2012-02-26  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26  6:34 proc:Add a reference of module when proc_reg_file opened majianpeng
2012-02-26  7:50 ` Al Viro [this message]

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=20120226075025.GC23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@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 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.