From: David Sterba <dsterba@suse.cz>
To: Martin Mailand <martin@tuxadero.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org
Subject: Re: kernel BUG at fs/btrfs/inode.c:1163
Date: Mon, 24 Oct 2011 13:39:30 +0200 [thread overview]
Message-ID: <20111024113930.GF26547@ds.suse.cz> (raw)
In-Reply-To: <4E9EC9C1.4030901@tuxadero.com>
On Wed, Oct 19, 2011 at 02:59:45PM +0200, Martin Mailand wrote:
> Am 19.10.2011 11:49, schrieb David Sterba:
> >It would be interesting what's the value of 'extent_type' at the time of
> >crash, if it's eg -1 that could point to a real bug, some unhandled
> >corner case in truncate, for example.
> >
>
> How can I do that?
something like that would print the type information during runtime
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1160,6 +1160,11 @@ next_slot:
btrfs_file_extent_inline_len(leaf, fi);
extent_end = ALIGN(extent_end, root->sectorsize);
} else {
+ printk(KERN_CRIT "btrfs: unhandled extent type %d, key=[%llu,%u,%llu]",
+ (unsigned long long)found_key.objecitd,
+ (unsigned)found_key.tyep,
+ (unsigned long long)found_key.offset,
+ extent_type);
BUG_ON(1);
}
out_check:
---
the key seems to be a relevant iformation to print as well, but the rest
stored in the leaf item could be just garbage.
The btrfs-debug-tree utility prints the whole tree items, but as I saw just now
in the case of extent, it skips an unknown type (the same where kernel
BUGs), which means that other extent data are glued to previous output
and thus cannot be spotted easily. To fix that, apply these changes to
progs' print-tree.c:
--- a/print-tree.c
+++ b/print-tree.c
@@ -138,7 +138,7 @@ static void print_file_extent_item(struct extent_buffer *eb,
btrfs_file_extent_inline_len(eb, fi),
btrfs_file_extent_compression(eb, fi));
return;
- }
+ } else
if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
printf("\t\tprealloc data disk byte %llu nr %llu\n",
(unsigned long long)btrfs_file_extent_disk_bytenr(eb, fi),
@@ -147,6 +147,8 @@ static void print_file_extent_item(struct extent_buffer *eb,
(unsigned long long)btrfs_file_extent_offset(eb, fi),
(unsigned long long)btrfs_file_extent_num_bytes(eb, fi));
return;
+ } else {
+ printf("*** ERROR unknown extent type %d\n", extent_type);
}
printf("\t\textent data disk byte %llu nr %llu\n",
(unsigned long long)btrfs_file_extent_disk_bytenr(eb, fi),
---
and run the utility on your fs.
david
next prev parent reply other threads:[~2011-10-24 11:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-18 20:04 kernel BUG at fs/btrfs/inode.c:1163 Martin Mailand
2011-10-19 9:49 ` David Sterba
2011-10-19 12:59 ` Martin Mailand
2011-10-24 11:39 ` David Sterba [this message]
2011-10-19 15:02 ` Anand Jain
2011-10-20 13:04 ` Martin Mailand
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=20111024113930.GF26547@ds.suse.cz \
--to=dsterba@suse.cz \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=martin@tuxadero.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