From: Liu Bo <bo.li.liu@oracle.com>
To: Zach Brown <zab@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix crash regarding to ulist_add_merge
Date: Thu, 27 Jun 2013 10:55:56 +0800 [thread overview]
Message-ID: <20130627025555.GD19614@localhost.localdomain> (raw)
In-Reply-To: <20130627022341.GE10265@lenny.home.zabbo.net>
On Wed, Jun 26, 2013 at 07:23:41PM -0700, Zach Brown wrote:
> > > But in the krealloc() case the rb_erase() will be trying to reference
> > > freed memmory because krealloc() frees the old pointer on success.
> >
> > Yeah, I realize that you're absolutely right, but my box
> > didn't complain about the abused old pointers when we're not in int_nodes
> > case, which is weird...
>
> The freed space probably just hasn't been reused yet. Have you tried
> with CONFIG_DEBUG_PAGEALLOC or CONFIG_DEBUG_SLAB?
>
> > > Yeah, it's insane, but no more so than using krealloc() for an array
> > > with internal pointers in the first place.
> >
> > I doubt if it can work, I'd prefer the re-insert dance.
>
> It should, but it is a disgusting hack. Not worth it if you can't get
> it going.
>
> Re-initializing the nodes instead of removing them after they're moved
> should work.
>
> But really, this is all bonkers. A ulist implementation that doesn't
> require this fixup would be better. Maybe lose the array and have a
> simple list_head and slab of allocated structs. Reliable first,
> performant second, presuming there's data to justify it.
I agree, I'm trying to work it out and will test it with DEBUG_PAGEALLOC ;)
thanks,
liubo
next prev parent reply other threads:[~2013-06-27 2:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 4:02 [PATCH] Btrfs: fix crash regarding to ulist_add_merge Liu Bo
2013-06-26 12:38 ` Josef Bacik
2013-06-27 1:03 ` Liu Bo
2013-06-26 20:18 ` Zach Brown
2013-06-26 20:19 ` Zach Brown
2013-06-27 1:40 ` Liu Bo
2013-06-27 2:23 ` Zach Brown
2013-06-27 2:55 ` Liu Bo [this message]
2013-06-27 1:51 ` Liu Bo
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=20130627025555.GD19614@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=zab@redhat.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