linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Peter Stuge <peter@stuge.se>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: resize ate my root node
Date: Tue, 08 Mar 2011 16:40:20 -0500	[thread overview]
Message-ID: <1299620014-sup-698@think> (raw)
In-Reply-To: <20110307174820.5100.qmail@stuge.se>

Excerpts from Peter Stuge's message of 2011-03-07 12:48:20 -0500:
> Hi,
> 
> I ran btrfsctl resize -r -3gb /dev/sda2 using wireless-testing.git
> based on 2.6.38-rc6 and all seemed good. df reported reduced size so
> I repartitioned and rebooted. Filesystem can no longer be mounted:
> 
> [10560.129038] device fsid b2408c2e83f55cc2-5f7a14e35f176484 devid 1 transid 341132 /dev/sdb2
> [10560.133407] btrfs bad tree block start 0 34520006656
> [10560.134031] btrfs bad tree block start 0 34520006656
> [10560.134904] btrfs bad tree block start 0 34520006656
> [10560.134912] btrfs: failed to read tree root on sdb2
> [10560.137206] btrfs: open_ctree failed
> 
> btrfs-debug-tree and friends are similarly upset:

Ouch, sorry about this.  Do you have details on how big the FS was and
how big the partition was before the resize?

Have you tried using fdisk to bring the partition back to the original
size?

-chris

> 
> $ ./btrfs-debug-tree /dev/sdb2
> btrfs-debug-tree: disk-io.c:739: open_ctree_fd: Assertion `!(!tree_root->node)' failed.
> 
> $ gdb --args ./btrfs-debug-tree /dev/sdb2
> GNU gdb 6.8
> ..
> (gdb) b disk-io.c:44
> Breakpoint 1 at 0x8050db7: file disk-io.c, line 44.
> ..
> Breakpoint 1, check_tree_block (root=0x946e2e8, buf=0x9471538) at disk-io.c:44
> 44              if (buf->start != btrfs_header_bytenr(buf))
> (gdb) p buf->start
> $1 = 20971520
> ..
> Breakpoint 1, check_tree_block (root=0x946e2e8, buf=0x9472588) at disk-io.c:44
> 44              if (buf->start != btrfs_header_bytenr(buf))
> (gdb) p buf->start
> $2 = 20987904
> ..
> Breakpoint 1, check_tree_block (root=0x946e2e8, buf=0x94735d8) at disk-io.c:44
> 44              if (buf->start != btrfs_header_bytenr(buf))
> (gdb) p buf->start
> $3 = 20983808
> 
> The above checks succeed but next time check_tree_block() is called
> the check does not succeed.
> 
> Breakpoint 1, check_tree_block (root=0x946e008, buf=0x9474628) at disk-io.c:44
> 44              if (buf->start != btrfs_header_bytenr(buf))
> (gdb) p buf->start
> $4 = 34520006656
> (gdb) p btrfs_header_bytenr(buf)
> $5 = 0
> ..
> (gdb) bt
> #0  check_tree_block (root=0x946e008, buf=0x9474628) at disk-io.c:45
> #1  0x080514fc in read_tree_block (root=0x946e008, bytenr=34520006656, 
>     blocksize=4096, parent_transid=341132) at disk-io.c:207
> #2  0x080531a7 in open_ctree_fd (fp=7, path=0xbfef322a "/dev/sdb2", 
>     sb_bytenr=65536, writes=0) at disk-io.c:736
> #3  0x08052a58 in open_ctree (filename=0xbfef322a "/dev/sdb2", sb_bytenr=0, 
>     writes=0) at disk-io.c:587
> #4  0x080735cf in main (ac=1, av=0xbfef2374) at debug-tree.c:148
> 
> This is disk-io.c:
> 
> 732     blocksize = btrfs_level_size(tree_root,
>                                      btrfs_super_root_level(disk_super));  
>         generation = btrfs_super_generation(disk_super);  
> 
>         tree_root->node = read_tree_block(tree_root,
>                                           btrfs_super_root(disk_super),
>                                           blocksize, generation);
> ..
> 188     eb = btrfs_find_create_tree_block(root, bytenr, blocksize);
> ..
> 198             ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
>                                       eb->start, &length, &multi, mirror_num);
> ..
> 206             ret = read_extent_from_disk(eb);
>                 if (ret == 0 && check_tree_block(root, eb) == 0 &&
> 
> This is the call that fails.
> 
> 
> Where do I look next?
> 
> 
> //Peter

  reply	other threads:[~2011-03-08 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 17:48 resize ate my root node Peter Stuge
2011-03-08 21:40 ` Chris Mason [this message]
2011-03-10  6:23   ` Peter Stuge
2011-03-10 13:18     ` Chris Mason
2011-04-18 21:01       ` Peter Stuge
2011-05-03 13:23         ` Peter Stuge
2011-03-10 13:19     ` Chris Mason
2011-03-10 13:45       ` Peter Stuge
2011-03-10 14:04         ` Chris Mason
2011-04-18 21:12           ` Peter Stuge

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=1299620014-sup-698@think \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=peter@stuge.se \
    /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).