All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v1.1] btrfs-progs: inspect-dump-tree: Allow '-b|--block' to be specified multiple times
Date: Tue, 5 Mar 2019 15:57:50 +0100	[thread overview]
Message-ID: <20190305145750.GB31119@twin.jikos.cz> (raw)
In-Reply-To: <20180601082746.3638-1-wqu@suse.com>

On Fri, Jun 01, 2018 at 04:27:46PM +0800, Qu Wenruo wrote:
> Reuse extent-cache facility to record multiple bytenr so '-b|--block'
> can be specified multiple times.
> 
> Despite that, add a sector size alignment check before we try to print a
> tree block.
> (Please note that, nodesize alignment check is not suitable here as meta
> chunk start bytenr could be unaligned to nodesize)
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

I'm going to add this patch to devel, but there's a crash when there's
not valid block on the offset, eg. 'btrfs inspect dump-tree -b 8192
/dev/'

$ ./btrfs inspect dump-tree -b 1024 -b 2048 -b 4096 -b 8192 zimg
btrfs-progs v4.20.2 
ERROR: tree block bytenr 1024 is not aligned to sectorsize 4096
ERROR: tree block bytenr 2048 is not aligned to sectorsize 4096
Couldn't map the block 4096
Invalid mapping for 4096-20480, got 13631488-22020096
Couldn't map the block 4096
bad tree block 4096, bytenr mismatch, want=4096, have=0
ERROR: failed to read tree block 4096
extent_io.c:665: free_extent_buffer_internal: BUG_ON `eb->refs < 0`
triggered, value 1
./btrfs[0x426e57]
./btrfs(free_extent_buffer+0xe)[0x427701]
./btrfs(alloc_extent_buffer+0x3f)[0x427872]
./btrfs(btrfs_find_create_tree_block+0xf)[0x415b3c]
./btrfs(read_tree_block+0x5c)[0x4171b5]
./btrfs(cmd_inspect_dump_tree+0x587)[0x46fb75]
./btrfs(handle_command_group+0x44)[0x40df89]
./btrfs(cmd_inspect+0x15)[0x44b569]
./btrfs(main+0x8b)[0x40e032]
/lib64/libc.so.6(__libc_start_main+0xeb)[0x7f2001a54b7b]
./btrfs(_start+0x2a)[0x40dd1a]
Aborted (core dumped)

I think the fix will be simple so I'll fold it in, otherwise the
multiple block offsets work and using the cache is ok.

      reply	other threads:[~2019-03-05 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  5:15 [PATCH REBASED 0/1] btrfs-progs: dump-tree: allow -b multiple times Qu Wenruo
2018-06-01  5:15 ` [PATCH REBASED 1/1] btrfs-progs: inspect-dump-tree: Allow '-b|--block' to be specified " Qu Wenruo
2018-06-01  6:54   ` Nikolay Borisov
2018-06-01  8:27   ` [PATCH v1.1] " Qu Wenruo
2019-03-05 14:57     ` David Sterba [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=20190305145750.GB31119@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.