From: Tejun Heo <htejun@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vincent Vanackere <vincent.vanackere@gmail.com>,
linux kernel mailing list <linux-kernel@vger.kernel.org>,
Greg KH <gregkh@suse.de>
Subject: Re: [OOPS 2.6.21-rc7-mm1] kernel BUG at fs/sysfs/inode.c:272 (sysfs_drop_dentry)
Date: Wed, 25 Apr 2007 05:15:55 +0900 [thread overview]
Message-ID: <20070424201555.GC17130@htj.dyndns.org> (raw)
In-Reply-To: <20070424105844.da798b07.akpm@linux-foundation.org>
On Tue, Apr 24, 2007 at 10:58:44AM -0700, Andrew Morton wrote:
> On Wed, 25 Apr 2007 02:51:43 +0900 Tejun Heo <htejun@gmail.com> wrote:
>
> > Andrew Morton wrote:
> > > On Wed, 25 Apr 2007 01:33:59 +0900 Tejun Heo <htejun@gmail.com> wrote:
> > >
> > >> Vincent Vanackere wrote:
> > >>> Hi,
> > >>>
> > >>> I'm getting the following oops at boot with the latest -mm kernel :
> > >>> ---------------------------------------------------------------
> > >>> kernel BUG at fs/sysfs/inode.c:272
> > >> Known problem. Working on it. Thanks.
> > >>
> > >
> > > If it had been known by me I wouldn't have released known-buggy code to
> > > people who need to be able to test other people's code too. (argh)
> > >
> >
> > It's the problem Cornelia reported in the thread the patch was posted.
>
> Is there a workaround? What might happen if we just delete that BUG_ON()?
Okay, here's the workaround. It leaks dentries and inodes if parent
is deleted first but other than that it should be okay.
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index eea50a5..b466671 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -212,8 +212,11 @@ static struct dentry *sysfs_lookup_sd(struct sysfs_dirent *sd)
depth = sysfs_path_depth(sd);
while (depth--) {
- /* negative intermediate node is a BUG */
- BUG_ON(!dentry->d_inode);
+ /* XXX */ /* negative intermediate node is a BUG */
+ /* XXX */ /* BUG_ON(!dentry->d_inode); */
+ if (!dentry->d_inode)
+ return NULL;
+ /* XXX */
for (cur = sd, i = 0; i < depth; i++)
cur = cur->s_parent;
@@ -269,7 +272,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
}
if (isdir) {
- BUG_ON(!simple_empty(dentry));
+ /* XXX */ /* BUG_ON(!simple_empty(dentry)); */
drop_nlink(dir);
/* unpin if directory */
dput(dentry);
prev parent reply other threads:[~2007-04-24 20:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-24 15:20 [OOPS 2.6.21-rc7-mm1] kernel BUG at fs/sysfs/inode.c:272 (sysfs_drop_dentry) Vincent Vanackere
2007-04-24 16:33 ` Tejun Heo
2007-04-24 17:33 ` Andrew Morton
2007-04-24 17:51 ` Tejun Heo
2007-04-24 17:58 ` Andrew Morton
2007-04-24 20:15 ` Tejun Heo [this message]
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=20070424201555.GC17130@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=vincent.vanackere@gmail.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