From: Sunil Mushran <Sunil.Mushran@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Barry Naujok <bnaujok@sgi.com>,
Anton Altaparmakov <aia21@cam.ac.uk>,
xfs@oss.sgi.com, linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache
Date: Tue, 20 May 2008 13:50:03 -0700 [thread overview]
Message-ID: <4833397B.2000109@oracle.com> (raw)
In-Reply-To: <20080520182315.GA8456@infradead.org>
Christoph Hellwig wrote:
> The cond_resched_lock here is not safe here, because the pointer you
> are going to dereference in list_for_each_entry might not be valid
> anymore. This should look more like:
>
> void d_drop_negative_children(struct dentry *parent)
> {
> struct dentry *dentry;
>
> again:
> spin_lock(&dcache_lock);
> list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
> if !(dentry->d_inode)
> continue;
>
> spin_lock(&dentry->d_lock);
> __d_drop(dentry);
> spin_unlock(&dentry->d_lock);
>
> if (need_resched()) {
> spin_unlock(&dcache_lock);
> cond_resched();
> goto again;
> }
> }
> spin_unlock(&dcache_lock);
> }
>
Yes, we have been bitten by the same issue.
Instead of need_resched(), it may be better if you do:
if (cond_resched_lock(&dcache_lock))
goto again;
next prev parent reply other threads:[~2008-05-20 20:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 7:57 [PATCH 0/4] XFS: Case-insensitive support - ASCII only Barry Naujok
2008-05-13 7:57 ` [PATCH 1/4] XFS: Name operation vector for hash and compare Barry Naujok
2008-05-13 8:31 ` Christoph Hellwig
2008-05-13 7:57 ` [PATCH 2/4] XFS: add op_flags field and helpers to xfs_da_args Barry Naujok
2008-05-13 8:34 ` Christoph Hellwig
2008-05-14 6:12 ` Barry Naujok
2008-05-13 7:57 ` [PATCH 3/4] XFS: Return case-insensitive match for dentry cache Barry Naujok
2008-05-13 8:57 ` Christoph Hellwig
2008-05-14 6:15 ` Barry Naujok
2008-05-14 7:55 ` Barry Naujok
2008-05-15 4:57 ` Christoph Hellwig
2008-05-15 5:14 ` Barry Naujok
2008-05-15 13:43 ` Anton Altaparmakov
2008-05-15 14:11 ` Christoph Hellwig
2008-05-16 0:30 ` Barry Naujok
2008-05-16 7:25 ` Anton Altaparmakov
2008-05-20 2:24 ` Barry Naujok
2008-05-20 18:23 ` Christoph Hellwig
2008-05-20 20:50 ` Sunil Mushran [this message]
2008-05-13 7:57 ` [PATCH 4/4] XFS: ASCII case-insensitive support Barry Naujok
2008-05-13 8:58 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2008-05-14 7:52 [PATCH 0/4] XFS: ASCII case-insensitivity support Barry Naujok
2008-05-14 7:52 ` [PATCH 3/4] XFS: Return case-insensitive match for dentry cache Barry Naujok
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=4833397B.2000109@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=aia21@cam.ac.uk \
--cc=bnaujok@sgi.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.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.