From: Christoph Hellwig <hch@lst.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix waitqueue leak in devfs_d_revalidate_wait
Date: Tue, 18 Mar 2003 10:56:25 +0100 [thread overview]
Message-ID: <20030318105625.B4424@lst.de> (raw)
devfs_d_revalidate_wait adds to a waitqueue but never removes from it
again so we there's one entry full of reused stack space added on
each call (I wonder how this ever worked).
The function has a few more bugs (it effectivly does a sleep_on instead
of checking for the actual even and can't deal with negative dentries
at all), but I just had breakfast and don't want to poke into devfs
internals deeper - I still hope Adam's smalldevfs will get merged
anyway..
--- 1.74/fs/devfs/base.c Mon Mar 17 01:33:08 2003
+++ edited/fs/devfs/base.c Tue Mar 18 09:37:29 2003
@@ -2336,6 +2232,8 @@
wait_queue_head_t wait_queue;
};
+/* XXX: this doesn't handle the case where we got a negative dentry
+ but a devfs entry has been registered in the meanwhile */
static int devfs_d_revalidate_wait (struct dentry *dentry, int flags)
{
struct inode *dir = dentry->d_parent->d_inode;
@@ -2380,6 +2278,7 @@
add_wait_queue (&lookup_info->wait_queue, &wait);
read_unlock (&parent->u.dir.lock);
schedule ();
+ remove_wait_queue (&lookup_info->wait_queue, &wait);
}
else read_unlock (&parent->u.dir.lock);
return 1;
next reply other threads:[~2003-03-18 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-18 9:56 Christoph Hellwig [this message]
2003-03-18 11:21 ` Andrew Morton
2003-03-18 12:16 ` Helge Hafting
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=20030318105625.B4424@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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 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®