From: Paul Menage <pmenage@ensim.com>
To: Matthew Wilcox <willy@debian.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: pmenage@ensim.com
Subject: Re: [PATCH] use list_* functions better in dcache.c
Date: Wed, 03 Jul 2002 11:04:21 -0700 [thread overview]
Message-ID: <afvekp$11i$2@main.gmane.org> (raw)
In-Reply-To: Your message of "Wed, 03 Jul 2002 17:02:11 BST." <20020703170211.N27706@parcelfarce.linux.theplanet.co.uk>
>@@ -382,42 +389,18 @@ void prune_dcache(int count)
>
> void shrink_dcache_sb(struct super_block * sb)
> {
>- struct list_head *tmp, *next;
>- struct dentry *dentry;
>-
>- /*
>- * Pass one ... move the dentries for the specified
>- * superblock to the most recent end of the unused list.
>- */
>- spin_lock(&dcache_lock);
Oops - you're walking dentry_unused without holding dcache_lock ...
>- next = dentry_unused.next;
>- while (next != &dentry_unused) {
>- tmp = next;
>- next = tmp->next;
>- dentry = list_entry(tmp, struct dentry, d_lru);
>- if (dentry->d_sb != sb)
>- continue;
>- list_del(tmp);
>- list_add(tmp, &dentry_unused);
>- }
>-
>- /*
>- * Pass two ... free the dentries for this superblock.
>- */
>-repeat:
>- next = dentry_unused.next;
>- while (next != &dentry_unused) {
>- tmp = next;
>- next = tmp->next;
>- dentry = list_entry(tmp, struct dentry, d_lru);
>+ struct list_head *entry, *next;
>+
>+ list_for_each_safe(entry, next, &dentry_unused) {
>+ struct dentry *dentry = list_entry(entry, struct dentry, d_lru);
> if (dentry->d_sb != sb)
next prev parent reply other threads:[~2002-07-03 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-03 16:02 [PATCH] use list_* functions better in dcache.c Matthew Wilcox
2002-07-03 18:04 ` Paul Menage [this message]
[not found] ` <E17PoUH-00065L-00@pmenage-dt.ensim.com>
2002-07-03 19:26 ` Matthew Wilcox
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='afvekp$11i$2@main.gmane.org' \
--to=pmenage@ensim.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=willy@debian.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