linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] fs/proc: Move kfree outside pde_unload_lock
Date: Wed, 29 Aug 2012 07:24:48 -0700	[thread overview]
Message-ID: <1346250288.2586.2.camel@edumazet-glaptop> (raw)
In-Reply-To: <CACVxJT_ZRvznb3M=jq_du_aJvRmjcAb3=LSXFGYFWe5W2xo93A@mail.gmail.com>

On Wed, 2012-08-29 at 16:50 +0300, Alexey Dobriyan wrote:
> On Wed, Aug 29, 2012 at 7:11 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > I'll polish this patch once LKS/LPC is over...
> 
> It should oops in the following way (excuse Gmail please):
> PDEO is removed from lists
> ->pde_users is 0
> PDE won't be in purge queue -- no ->release while module is alive
> 
> Current code removes PDEO and checks if PDE scheduled for removal atomically.
> 
> proc_reg_release                                        remove_proc_entry
> 
>                                                         de->proc_fops = NULL;
> release = pde_opener_del(inode, file);
> rcu_read_lock();
>                                                         synchronize_rcu();
> fops = rcu_dereference(pde->proc_fops);
> if (!fops) {
>         rcu_read_unlock();
>                          ----------------------------------
>                                                         /* NOP */
>                                                         while
> (atomic_read(&de->pde_users))
>                                                                 ...
>                                                         /* NOP */
> 
> pde_openers_purge(de, &purge_queue);
>                                                         /* NOP */
>                                                         while
> (!list_empty(&purge_queue))
>                                                                 ...
>                                                         rmmod
> 
>         if (release)
>                 release(inode, file) /* OOPS */

Fix should be trivial, proper module refcount for example.

As I said, I would do that after LKS/LPC, there is no hurry.




  reply	other threads:[~2012-08-29 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 16:38 [PATCH] fs/proc: Move kfree outside pde_unload_lock Nathan Zimmer
2012-08-22 16:38 ` [PATCH] fs/prof: Update comment on pde_unload_lock Nathan Zimmer
2012-08-22 18:28 ` [PATCH] fs/proc: Move kfree outside pde_unload_lock Eric Dumazet
2012-08-22 21:42   ` Eric Dumazet
2012-08-23 17:54     ` Nathan Zimmer
2012-08-24 14:48     ` Nathan Zimmer
2012-08-24 14:58       ` Eric Dumazet
2012-08-24 16:45         ` Nathan Zimmer
2012-08-24 21:43           ` Nathan Zimmer
2012-08-28 20:38     ` Alexey Dobriyan
2012-08-29  4:11       ` Eric Dumazet
2012-08-29  8:32         ` Alexey Dobriyan
2012-08-29 13:50         ` Alexey Dobriyan
2012-08-29 14:24           ` Eric Dumazet [this message]
2012-09-17 15:57             ` Nathan Zimmer

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=1346250288.2586.2.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nzimmer@sgi.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).