From: Liu Bo <bo.li.liu@oracle.com>
To: Zach Brown <zab@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3] Btrfs: fix crash regarding to ulist_add_merge
Date: Sat, 29 Jun 2013 18:46:50 +0800 [thread overview]
Message-ID: <20130629104649.GA7849@localhost.localdomain> (raw)
In-Reply-To: <20130628194314.GH10265@lenny.home.zabbo.net>
On Fri, Jun 28, 2013 at 12:43:14PM -0700, Zach Brown wrote:
> On Fri, Jun 28, 2013 at 12:37:45PM +0800, Liu Bo wrote:
> > Several users reported this crash of NULL pointer or general protection,
> > the story is that we add a rbtree for speedup ulist iteration, and we
> > use krealloc() to address ulist growth, and krealloc() use memcpy to copy
> > old data to new memory area, so it's OK for an array as it doesn't use
> > pointers while it's not OK for a rbtree as it uses pointers.
> >
> > So krealloc() will mess up our rbtree and it ends up with crash.
> >
> > Reviewed-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
>
> Yeah, this should fix the probem. Thanks for being persistent.
>
> Reviewed-by: Zach Brown <zab@redhat.com>
>
> > + for (i = 0; i < ulist->nnodes; i++)
> > + rb_erase(&ulist->nodes[i].rb_node, &ulist->root);
>
> (still twitching over here because this is a bunch of work that achieves
> nothing :))
Hmm, I think that this is necessary for the inline array inside ulist,
so I keep it :)
- liubo
next prev parent reply other threads:[~2013-06-29 10:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 4:37 [PATCH v3] Btrfs: fix crash regarding to ulist_add_merge Liu Bo
2013-06-28 19:43 ` Zach Brown
2013-06-29 10:46 ` Liu Bo [this message]
2013-07-29 8:23 ` Jan Schmidt
2013-07-29 13:11 ` 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=20130629104649.GA7849@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;
as well as URLs for NNTP newsgroup(s).