mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Kirill Korotaev <dev@sw.ru>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix of dcache race leading to busy inodes on umount
Date: Wed, 11 May 2005 19:33:52 -0700	[thread overview]
Message-ID: <20050511193352.2c9a9201.akpm@osdl.org> (raw)
In-Reply-To: <42822A2A.6000909@sw.ru>

Kirill Korotaev <dev@sw.ru> wrote:
>
> This patch fixes dcache race between shrink_dcache_XXX functions
> and dput().
> 
> Example race scenario:
> 
> 	CPU 0				CPU 1
> umount /dev/sda1
> generic_shutdown_super          shrink_dcache_memory()
> shrink_dcache_parent            dput dentry
> select_parent                   prune_one_dentry()
>                                  <<<< child is dead, locks are released,
>                                    but parent is still referenced!!! >>>>
> 
> skip dentry->parent,
> since it's d_count > 0
> 
> message: BUSY inodes after umount...
>                                  <<< parent is left on dentry_unused
> 				   list, referencing freed super block
> 
> We faced these messages about busy inodes constantly after some stress 
> testing with mount/umount operations parrallel with some other activity.
> This patch helped the problem.
> 
> The patch was heavilly tested on 2.6.8 during 2 months,
> this forward-ported version boots and works ok as well.
> 

You've provided no description of how the patch solves the problem.

> /* dcache_lock protects shrinker's list */
> static void shrink_dcache_racecheck(struct dentry *parent, int *racecheck)
> {
> 	struct super_block *sb;
> 	struct dcache_shrinker *ds;
> 
> 	sb = parent->d_sb;
> 	list_for_each_entry(ds, &sb->s_dshrinkers, list) {
> 		/* is one of dcache shrinkers working on the dentry? */
> 		if (ds->dentry == parent) {
> 			*racecheck = 1;
> 			break;
> 		}
> 	}
> }
> 
> 

This all looks awfully hacky.  Why is it done this way, and is there no
cleaner solution?

  parent reply	other threads:[~2005-05-12  2:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11 15:52 Kirill Korotaev
2005-05-12  2:29 ` Andrew Morton
2005-05-12  8:31   ` Kirill Korotaev
2005-05-12  2:33 ` Andrew Morton [this message]
2005-05-12 10:25   ` Kirill Korotaev

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=20050511193352.2c9a9201.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dev@sw.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®