linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Lukas Pirl <btrfs@lukas-pirl.de>
Cc: linux-btrfs@vger.kernel.org, calestyo@scientia.net,
	L.Bonnaud@laposte.net
Subject: Re: bad extent [5993525264384, 5993525280768), type mismatch with chunk
Date: Sun, 22 Nov 2015 10:04:26 +0800	[thread overview]
Message-ID: <565122AA.90904@gmx.com> (raw)
In-Reply-To: <564FC3FE.9020905@lukas-pirl.de>

Hi Lukas, Laurent and Christoph,

If any of you can recompile btrfs-progs and use gdb to debug it, would 
anyone please to investigate where did the wrong_chunk_type is set?

It is in the function check_extent_type():
------
/* Check if the type of extent matches with its chunk */
static void check_extent_type(struct extent_record *rec)
{
	struct btrfs_block_group_cache *bg_cache;

	bg_cache = btrfs_lookup_first_block_group(global_info, rec->start);
	if (!bg_cache)
		return;

	/* data extent, check chunk directly*/
	if (!rec->metadata) {
		if (!(bg_cache->flags & BTRFS_BLOCK_GROUP_DATA))
			rec->wrong_chunk_type = 1; <<< HERE
		return;
	}

	/* metadata extent, check the obvious case first */
	if (!(bg_cache->flags & (BTRFS_BLOCK_GROUP_SYSTEM |
				 BTRFS_BLOCK_GROUP_METADATA))) {
		rec->wrong_chunk_type = 1; <<< HERE
		return;
	}

	/*
	 * Check SYSTEM extent, as it's also marked as metadata, we can only
	 * make sure it's a SYSTEM extent by its backref
	 */
	if (!list_empty(&rec->backrefs)) {
		struct extent_backref *node;
		struct tree_backref *tback;
		u64 bg_type;

		node = list_entry(rec->backrefs.next, struct extent_backref,
				  list);
		if (node->is_data) {
			/* tree block shouldn't have data backref */
			rec->wrong_chunk_type = 1; <<< HERE
			return;
		}
		tback = container_of(node, struct tree_backref, node);

		if (tback->root == BTRFS_CHUNK_TREE_OBJECTID)
			bg_type = BTRFS_BLOCK_GROUP_SYSTEM;
		else
			bg_type = BTRFS_BLOCK_GROUP_METADATA;
		if (!(bg_cache->flags & bg_type))
			rec->wrong_chunk_type = 1; <<< HERE
	}
}
------

If you can add break point on the "rec->wrong_chunk_type = 1;" line, it 
would be quite helpful for further debugging.

Thanks,
Qu
On 11/21/2015 09:08 AM, Lukas Pirl wrote:
> On 11/21/2015 01:47 PM, Qu Wenruo wrote as excerpted:
>> Hard to say, but we'd better keep an eye on this issue.
>> At least, if it happens again, we should know if it's related to
>> something like newer kernel or snapshots.
>
> I can confirm the initially describe behavior of "btrfs check" and
> reading the data works fine also.
>
> Versions etc.:
>
> $ uname -a
> Linux 4.2.0-0.bpo.1-amd64 #1 SMP Debian 4.2.6-1~bpo8+1 …
> $ btrfs filesystem show /mnt/data
> Label: none  uuid: 5be372f5-5492-4f4b-b641-c14f4ad8ae23
>          Total devices 6 FS bytes used 2.87TiB
>          devid    1 size 931.51GiB used 636.00GiB path /dev/mapper/…SZ
>          devid    2 size 931.51GiB used 634.03GiB path /dev/mapper/…03
>          devid    3 size 1.82TiB used 1.53TiB path /dev/mapper/…76
>          devid    4 size 1.82TiB used 1.53TiB path /dev/mapper/…78
>          devid    6 size 1.82TiB used 1.05TiB path /dev/mapper/…UK
>          *** Some devices missing
>
> btrfs-progs v4.3
>
> $ btrfs subvolume list /mnt/data | wc -l
> 62
>
> Best,
>
> Lukas
> --
> 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:[~2015-11-22  2:04 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 21:51 bad extent [5993525264384, 5993525280768), type mismatch with chunk Christoph Anton Mitterer
2015-11-12 22:23 ` Christoph Anton Mitterer
2015-11-13  2:13 ` Qu Wenruo
2015-11-13  2:26   ` Christoph Anton Mitterer
2015-11-13  2:52     ` Qu Wenruo
2015-11-13  3:03       ` Christoph Anton Mitterer
2015-11-13  3:23         ` Qu Wenruo
2015-11-13  3:31           ` Christoph Anton Mitterer
2015-11-13  3:44           ` Christoph Anton Mitterer
2015-11-13  3:57       ` Christoph Anton Mitterer
2015-11-13  7:05         ` Duncan
2015-11-13  9:55           ` Christoph Anton Mitterer
2015-11-13 11:37             ` Christoph Anton Mitterer
     [not found]       ` <564F48FE.4000400@laposte.net>
2015-11-20 19:24         ` Christoph Anton Mitterer
2015-11-21  0:47           ` Qu Wenruo
2015-11-21  1:08             ` Lukas Pirl
2015-11-22  2:04               ` Qu Wenruo [this message]
2015-11-22  6:56                 ` Christoph Anton Mitterer
2015-11-23  1:10                   ` Qu Wenruo
2015-11-23 18:12                     ` Christoph Anton Mitterer
2015-11-24  0:46                       ` Qu Wenruo
2015-11-24  1:53                         ` Christoph Anton Mitterer
2015-11-24  2:09                           ` Qu Wenruo
2015-11-24  2:48                             ` Christoph Anton Mitterer
2015-11-24  2:54                               ` Qu Wenruo
2015-11-24  3:02                                 ` Christoph Anton Mitterer
2015-11-24  5:35                                   ` Qu Wenruo
2015-11-24 18:25                                     ` Christoph Anton Mitterer
2015-11-25  0:02                                       ` Qu Wenruo
2015-11-25  0:59                                       ` Qu Wenruo
2015-11-25  3:35                                         ` Christoph Anton Mitterer
2015-11-25  4:16                                           ` Christoph Anton Mitterer
2015-11-24 17:39                         ` David Sterba
2015-11-22 10:17                 ` Laurent Bonnaud
2015-11-23  1:00                   ` Qu Wenruo
2015-11-24 13:15                     ` Laurent Bonnaud
2015-11-24 23:46                       ` Qu Wenruo
2015-11-25  9:05                         ` Laurent Bonnaud
2015-12-03 17:13                           ` Laurent Bonnaud
2015-12-04  0:47                             ` Qu Wenruo
2015-12-11 13:22                               ` Laurent Bonnaud
2015-12-11 14:21                               ` Laurent Bonnaud
2015-12-14  0:53                                 ` Qu Wenruo
2015-12-14 12:47                                 ` Laurent Bonnaud
2015-12-15  1:16                                   ` Qu Wenruo
2015-11-24 23:53                       ` Qu Wenruo
2015-11-14  1:22 ` Qu Wenruo
2015-11-14  2:29   ` Christoph Anton Mitterer
2015-11-15  1:29     ` Qu Wenruo
2015-11-15  3:24       ` Christoph Anton Mitterer
2016-02-16  0:14 ` Ángel González
2016-02-16  1:38   ` Qu Wenruo
2016-02-16 22:21     ` Ángel González
2016-02-17  7:26       ` Qu Wenruo
2016-02-17 23:56         ` Ángel González

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=565122AA.90904@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=L.Bonnaud@laposte.net \
    --cc=btrfs@lukas-pirl.de \
    --cc=calestyo@scientia.net \
    --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).