linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: <dsterba@suse.cz>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs-progs: add sys_chunk_array and backup roots info to show-super
Date: Fri, 16 May 2014 09:17:31 +0800	[thread overview]
Message-ID: <1400203051.21609.1.camel@localhost.localdomain> (raw)
In-Reply-To: <20140515163538.GP6917@twin.jikos.cz>

On Thu, 2014-05-15 at 18:35 +0200, David Sterba wrote:
> On Thu, May 08, 2014 at 11:03:57AM +0800, Gui Hecheng wrote:
> > Add sys chunk array and backup roots info if the new option '-f'
> > if specified.
> > This may be useful for debugging sys_chunk related issues.
> 
> Sounds useful. One comment below.
> 
> > +static void print_sys_chunk_array(struct btrfs_super_block *sb)
> > +{
> > +	struct extent_buffer *buf;
> > +	struct btrfs_disk_key *disk_key;
> > +	struct btrfs_chunk *chunk;
> > +	struct btrfs_key key;
> > +	u8 *ptr, *array_end;
> > +	u32 num_stripes;
> > +	u32 len = 0;
> > +	int i = 0;
> > +
> > +	buf = malloc(sizeof(*buf) + sizeof(*sb));
> 
> Unchecked memory allocation

Yes, indeed. I'll resend. Thanks, David.

> > +	write_extent_buffer(buf, sb, 0, sizeof(*sb));
> > +	ptr = sb->sys_chunk_array;
> > +	array_end = ptr + btrfs_super_sys_array_size(sb);
> > +
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



      reply	other threads:[~2014-05-16  1:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  3:03 [PATCH 1/2] btrfs-progs: add sys_chunk_array and backup roots info to show-super Gui Hecheng
2014-05-08  3:03 ` [PATCH 2/2] btrfs-progs: update man page for btrfs-show-super Gui Hecheng
2014-05-15 16:35 ` [PATCH 1/2] btrfs-progs: add sys_chunk_array and backup roots info to show-super David Sterba
2014-05-16  1:17   ` Gui Hecheng [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=1400203051.21609.1.camel@localhost.localdomain \
    --to=guihc.fnst@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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).