All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel BUG at fs/btrfs/extent_io.c:1890!
@ 2012-04-11 14:44 Francesco Cepparo
  2012-04-11 15:01 ` Josef Bacik
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Cepparo @ 2012-04-11 14:44 UTC (permalink / raw)
  To: linux-btrfs

Hi, I've been using btrfs for a while now, and some months ago one of
my filesystems stopped mounting. I tried to fix it by mounting it with
the recovery option, by using btrfs-zero-log and by restoring the
superblock but it didn't work, so I left the filesystem standing there
waiting for the fsck repairing tool to be released (running the
version of fsck I had at the time produced the following output:
http://dl.dropbox.com/u/2565562/btrfsck-old-output while running the
2012-03-28 version of btrfsck produces the following output:
http://dl.dropbox.com/u/2565562/btrfsck-20120328-output.gz ).
I'm still waiting for the repairing tool and I haven't tried the
dangerous don't ever use branch, but as I have updated the kernel to
version 3.4.0-rc2 I tried to mount the filesystem again with the new
kernel, and instead of failing with this error message:
http://dl.dropbox.com/u/2565562/btrfs-kernel-3.3 as it did with kernel
3.3.1 and the previous kernels, with 3.4.0-rc2 it now hits the
following kernel BUG:
http://dl.dropbox.com/u/2565562/btrfs-kernel-3.4-bug

I hope I can be of any help in improving the already great btrfs.
Also, is there any hope for me to recover my old filesystem? :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-11 14:44 kernel BUG at fs/btrfs/extent_io.c:1890! Francesco Cepparo
@ 2012-04-11 15:01 ` Josef Bacik
  2012-04-11 23:59   ` Francesco Cepparo
  0 siblings, 1 reply; 10+ messages in thread
From: Josef Bacik @ 2012-04-11 15:01 UTC (permalink / raw)
  To: Francesco Cepparo; +Cc: linux-btrfs

On Wed, Apr 11, 2012 at 02:44:26PM +0000, Francesco Cepparo wrote:
> Hi, I've been using btrfs for a while now, and some months ago one of
> my filesystems stopped mounting. I tried to fix it by mounting it with
> the recovery option, by using btrfs-zero-log and by restoring the
> superblock but it didn't work, so I left the filesystem standing there
> waiting for the fsck repairing tool to be released (running the
> version of fsck I had at the time produced the following output:
> http://dl.dropbox.com/u/2565562/btrfsck-old-output while running the
> 2012-03-28 version of btrfsck produces the following output:
> http://dl.dropbox.com/u/2565562/btrfsck-20120328-output.gz ).
> I'm still waiting for the repairing tool and I haven't tried the
> dangerous don't ever use branch, but as I have updated the kernel to
> version 3.4.0-rc2 I tried to mount the filesystem again with the new
> kernel, and instead of failing with this error message:
> http://dl.dropbox.com/u/2565562/btrfs-kernel-3.3 as it did with kernel
> 3.3.1 and the previous kernels, with 3.4.0-rc2 it now hits the
> following kernel BUG:
> http://dl.dropbox.com/u/2565562/btrfs-kernel-3.4-bug
> 
> I hope I can be of any help in improving the already great btrfs.
> Also, is there any hope for me to recover my old filesystem? :)

Sorry, can you try this patch and see if it stops panicing, thanks,

Josef


diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 20196f4..2a3ddd2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -383,17 +383,17 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
 		if (test_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags))
 			break;
 
+		num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
+					      eb->start, eb->len);
+		if (num_copies == 1)
+			break;
+
 		if (!failed_mirror) {
 			failed = 1;
 			printk(KERN_ERR "failed mirror was %d\n", eb->failed_mirror);
 			failed_mirror = eb->failed_mirror;
 		}
 
-		num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
-					      eb->start, eb->len);
-		if (num_copies == 1)
-			break;
-
 		mirror_num++;
 		if (mirror_num == failed_mirror)
 			mirror_num++;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-11 15:01 ` Josef Bacik
@ 2012-04-11 23:59   ` Francesco Cepparo
  2012-04-12 18:08     ` Josef Bacik
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Cepparo @ 2012-04-11 23:59 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs

I tried your patch but unfortunately the kernel still gives me the
same error message :(



On Wed, Apr 11, 2012 at 3:01 PM, Josef Bacik <josef@redhat.com> wrote:
> On Wed, Apr 11, 2012 at 02:44:26PM +0000, Francesco Cepparo wrote:
>> Hi, I've been using btrfs for a while now, and some months ago one o=
f
>> my filesystems stopped mounting. I tried to fix it by mounting it wi=
th
>> the recovery option, by using btrfs-zero-log and by restoring the
>> superblock but it didn't work, so I left the filesystem standing the=
re
>> waiting for the fsck repairing tool to be released (running the
>> version of fsck I had at the time produced the following output:
>> http://dl.dropbox.com/u/2565562/btrfsck-old-output while running the
>> 2012-03-28 version of btrfsck produces the following output:
>> http://dl.dropbox.com/u/2565562/btrfsck-20120328-output.gz ).
>> I'm still waiting for the repairing tool and I haven't tried the
>> dangerous don't ever use branch, but as I have updated the kernel to
>> version 3.4.0-rc2 I tried to mount the filesystem again with the new
>> kernel, and instead of failing with this error message:
>> http://dl.dropbox.com/u/2565562/btrfs-kernel-3.3 as it did with kern=
el
>> 3.3.1 and the previous kernels, with 3.4.0-rc2 it now hits the
>> following kernel BUG:
>> http://dl.dropbox.com/u/2565562/btrfs-kernel-3.4-bug
>>
>> I hope I can be of any help in improving the already great btrfs.
>> Also, is there any hope for me to recover my old filesystem? :)
>
> Sorry, can you try this patch and see if it stops panicing, thanks,
>
> Josef
>
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 20196f4..2a3ddd2 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -383,17 +383,17 @@ static int btree_read_extent_buffer_pages(struc=
t btrfs_root *root,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (test_bit(EXTENT_BUFFER_CORRUPT, &e=
b->bflags))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
>
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 num_copies =3D btrfs_num_copies(&root->=
fs_info->mapping_tree,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 eb->start, eb->len);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (num_copies =3D=3D 1)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!failed_mirror) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0failed =3D 1;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(KERN_ERR "faile=
d mirror was %d\n", eb->failed_mirror);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0failed_mirror =3D eb->=
failed_mirror;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 num_copies =3D btrfs_num_copies(&root->=
fs_info->mapping_tree,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 eb->start, eb->len);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (num_copies =3D=3D 1)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mirror_num++;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (mirror_num =3D=3D failed_mirror)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mirror_num++;
--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-11 23:59   ` Francesco Cepparo
@ 2012-04-12 18:08     ` Josef Bacik
  2012-04-12 18:15       ` Chris Mason
  0 siblings, 1 reply; 10+ messages in thread
From: Josef Bacik @ 2012-04-12 18:08 UTC (permalink / raw)
  To: Francesco Cepparo; +Cc: Josef Bacik, linux-btrfs

On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wrote:
> I tried your patch but unfortunately the kernel still gives me the
> same error message :(
 
Weird, will you apply this patch on top of the one I sent you and send me the
dmesg when it panics again?  Thanks,

Josef

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2a3ddd2..51efb58 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
 
 	eb = (struct extent_buffer *)page->private;
 	set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
+	WARN_ON(!failed_mirror);
+	printk(KERN_ERR "io error, failed mirror %d\n");
 	eb->failed_mirror = failed_mirror;
 	if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
 		btree_readahead_hook(root, eb, eb->start, -EIO);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-12 18:08     ` Josef Bacik
@ 2012-04-12 18:15       ` Chris Mason
  2012-04-12 18:20         ` Josef Bacik
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Mason @ 2012-04-12 18:15 UTC (permalink / raw)
  To: Josef Bacik; +Cc: Francesco Cepparo, linux-btrfs

On Thu, Apr 12, 2012 at 02:08:37PM -0400, Josef Bacik wrote:
> On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wrote:
> > I tried your patch but unfortunately the kernel still gives me the
> > same error message :(
>  
> Weird, will you apply this patch on top of the one I sent you and send me the
> dmesg when it panics again?  Thanks,
> 
> Josef
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 2a3ddd2..51efb58 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
>  
>  	eb = (struct extent_buffer *)page->private;
>  	set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
> +	WARN_ON(!failed_mirror);
> +	printk(KERN_ERR "io error, failed mirror %d\n");
                                                    ^^^^^

						    , failed_mirror

-chris

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-12 18:15       ` Chris Mason
@ 2012-04-12 18:20         ` Josef Bacik
  2012-04-12 21:56           ` Francesco Cepparo
  0 siblings, 1 reply; 10+ messages in thread
From: Josef Bacik @ 2012-04-12 18:20 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, Francesco Cepparo, linux-btrfs

On Thu, Apr 12, 2012 at 02:15:25PM -0400, Chris Mason wrote:
> On Thu, Apr 12, 2012 at 02:08:37PM -0400, Josef Bacik wrote:
> > On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wrote:
> > > I tried your patch but unfortunately the kernel still gives me the
> > > same error message :(
> >  
> > Weird, will you apply this patch on top of the one I sent you and send me the
> > dmesg when it panics again?  Thanks,
> > 
> > Josef
> > 
> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> > index 2a3ddd2..51efb58 100644
> > --- a/fs/btrfs/disk-io.c
> > +++ b/fs/btrfs/disk-io.c
> > @@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
> >  
> >  	eb = (struct extent_buffer *)page->private;
> >  	set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
> > +	WARN_ON(!failed_mirror);
> > +	printk(KERN_ERR "io error, failed mirror %d\n");
>                                                     ^^^^^
> 
> 						    , failed_mirror
> 

pfft compiling debug patches before sending them out is for losers,

Josef

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-12 18:20         ` Josef Bacik
@ 2012-04-12 21:56           ` Francesco Cepparo
  2012-04-13 14:45             ` Josef Bacik
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Cepparo @ 2012-04-12 21:56 UTC (permalink / raw)
  To: Josef Bacik; +Cc: chris.mason, linux-btrfs

On Thu, Apr 12, 2012 at 6:20 PM, Josef Bacik <josef@redhat.com> wrote:
> On Thu, Apr 12, 2012 at 02:15:25PM -0400, Chris Mason wrote:
>> On Thu, Apr 12, 2012 at 02:08:37PM -0400, Josef Bacik wrote:
>> > On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wrote:
>> > > I tried your patch but unfortunately the kernel still gives me t=
he
>> > > same error message :(
>> >
>> > Weird, will you apply this patch on top of the one I sent you and =
send me the
>> > dmesg when it panics again? =A0Thanks,
>> >
>> > Josef
>> >
>> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> > index 2a3ddd2..51efb58 100644
>> > --- a/fs/btrfs/disk-io.c
>> > +++ b/fs/btrfs/disk-io.c
>> > @@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page *p=
age, int failed_mirror)
>> >
>> > =A0 =A0 eb =3D (struct extent_buffer *)page->private;
>> > =A0 =A0 set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
>> > + =A0 WARN_ON(!failed_mirror);
>> > + =A0 printk(KERN_ERR "io error, failed mirror %d\n");
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^
>>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , failed_mirror
>>
>
> pfft compiling debug patches before sending them out is for losers,
>
> Josef

I applied your second patch on top of the first one but the dmesg
output stays the same.... before you ask, I'm sure I'm compiling the
kernel correctly, as putting the WARN_ON(!failed_mirror) inside the if
(!failed_mirror) on line 391 correctly prints the warnings... I'm not
sure whether the warnings generated in that place are of any interest
but showing them anyway can't hurt:

[   87.041600] device fsid 0a6e2f08-5bfe-434c-ae27-f8670bef9a1c devid
1 transid 168138 /dev/sda6
[   87.041944] btrfs: disk space caching is enabled
[   87.417258] parent transid verify failed on 195091890176 wanted
168040 found 168229
[   87.418315] parent transid verify failed on 195091890176 wanted
168040 found 168229
[   87.418356] failed mirror was 0
[   87.418367] ------------[ cut here ]------------
[   87.418387] WARNING: at fs/btrfs/disk-io.c:394
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160()
[   87.418416] Hardware name: P5Q SE/R
[   87.418428] Modules linked in: fuse ext4 crc16 jbd2 mbcache rt73usb
rt2x00usb snd_hda_codec_hdmi crc_itu_t rt2x00lib usbhid uvcvideo hid
videobuf2_vmalloc videobuf2_memops videobuf2_core arc4 stv0299
snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm
snd_page_alloc snd_timer snd rtl8180 eeprom_93cx6 mac80211 budget_av
budget_core cfg80211 ttpci_eeprom radeon saa7146_vv i2c_algo_bit atl1e
soundcore rfkill saa7146 drm_kms_helper dvb_core videobuf_dma_sg
videobuf_core videodev evdev media ttm drm psmouse serio_raw iTCO_wdt
iTCO_vendor_support button coretemp intel_agp i2c_i801 microcode
intel_gtt processor i2c_core asus_atk0110 autofs4 uhci_hcd ehci_hcd
usbcore usb_common sd_mod ahci sr_mod cdrom libahci pata_marvell
libata scsi_mod
[   87.418835] Pid: 735, comm: mount Not tainted 3.4.0-rc2-mainline #5
[   87.418854] Call Trace:
[   87.418867]  [<ffffffff810515ff>] warn_slowpath_common+0x7f/0xc0
[   87.418887]  [<ffffffff8105165a>] warn_slowpath_null+0x1a/0x20
[   87.418907]  [<ffffffff81208aaa>]
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160
[   87.418934]  [<ffffffff8120928a>] read_tree_block+0x3a/0x50
[   87.418953]  [<ffffffff811eec73>] read_block_for_search.isra.33+0x1f=
3/0x3a0
[   87.418975]  [<ffffffff811ee39b>] ?
generic_bin_search.constprop.35+0x6b/0x180
[   87.418998]  [<ffffffff811f107c>] btrfs_search_slot+0x3ec/0x900
[   87.419018]  [<ffffffff81206a00>] ? verify_parent_transid+0x160/0x16=
0
[   87.419039]  [<ffffffff8120089f>] btrfs_read_block_groups+0xdf/0x660
[   87.419060]  [<ffffffff811f43f9>] ? update_space_info+0x199/0x1f0
[   87.419080]  [<ffffffff8120ce12>] open_ctree+0x1392/0x1ac0
[   87.420210]  [<ffffffff812b0901>] ? disk_name+0x61/0xc0
[   87.421352]  [<ffffffff811e8666>] btrfs_mount+0x5b6/0x6a0
[   87.422469]  [<ffffffff8112cbcb>] ? pcpu_alloc+0x8bb/0x9d0
[   87.423598]  [<ffffffff812c3a38>] ? ida_get_new_above+0x218/0x2a0
[   87.424752]  [<ffffffff8116fce3>] mount_fs+0x43/0x1b0
[   87.425869]  [<ffffffff8112ccf0>] ? __alloc_percpu+0x10/0x20
[   87.426988]  [<ffffffff81189e70>] vfs_kern_mount+0x70/0x100
[   87.428123]  [<ffffffff8118a394>] do_kern_mount+0x54/0x110
[   87.429219]  [<ffffffff8118bc7a>] do_mount+0x26a/0x850
[   87.430320]  [<ffffffff811274bb>] ? strndup_user+0x5b/0x80
[   87.431401]  [<ffffffff8118c39d>] sys_mount+0x8d/0xe0
[   87.432473]  [<ffffffff814d15e9>] system_call_fastpath+0x16/0x1b
[   87.433554] ---[ end trace 63bca69dcc9ebeb7 ]---
[   87.434641] io error, failed mirror 0
[   87.435988] parent transid verify failed on 195091890176 wanted
168040 found 168229
[   87.437144] failed mirror was 0
[   87.438252] ------------[ cut here ]------------
[   87.439380] WARNING: at fs/btrfs/disk-io.c:394
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160()
[   87.440551] Hardware name: P5Q SE/R
[   87.441722] Modules linked in: fuse ext4 crc16 jbd2 mbcache rt73usb
rt2x00usb snd_hda_codec_hdmi crc_itu_t rt2x00lib usbhid uvcvideo hid
videobuf2_vmalloc videobuf2_memops videobuf2_core arc4 stv0299
snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm
snd_page_alloc snd_timer snd rtl8180 eeprom_93cx6 mac80211 budget_av
budget_core cfg80211 ttpci_eeprom radeon saa7146_vv i2c_algo_bit atl1e
soundcore rfkill saa7146 drm_kms_helper dvb_core videobuf_dma_sg
videobuf_core videodev evdev media ttm drm psmouse serio_raw iTCO_wdt
iTCO_vendor_support button coretemp intel_agp i2c_i801 microcode
intel_gtt processor i2c_core asus_atk0110 autofs4 uhci_hcd ehci_hcd
usbcore usb_common sd_mod ahci sr_mod cdrom libahci pata_marvell
libata scsi_mod
[   87.447250] Pid: 735, comm: mount Tainted: G        W
3.4.0-rc2-mainline #5
[   87.449907] Call Trace:
[   87.452654]  [<ffffffff810515ff>] warn_slowpath_common+0x7f/0xc0
[   87.455507]  [<ffffffff8105165a>] warn_slowpath_null+0x1a/0x20
[   87.458309]  [<ffffffff81208aaa>]
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160
[   87.459966]  [<ffffffff8120928a>] read_tree_block+0x3a/0x50
[   87.461442]  [<ffffffff811eec73>] read_block_for_search.isra.33+0x1f=
3/0x3a0
[   87.462910]  [<ffffffff811ee39b>] ?
generic_bin_search.constprop.35+0x6b/0x180
[   87.464334]  [<ffffffff811f107c>] btrfs_search_slot+0x3ec/0x900
[   87.465752]  [<ffffffff81206a00>] ? verify_parent_transid+0x160/0x16=
0
[   87.467171]  [<ffffffff8120089f>] btrfs_read_block_groups+0xdf/0x660
[   87.468571]  [<ffffffff811f43f9>] ? update_space_info+0x199/0x1f0
[   87.469956]  [<ffffffff8120ce12>] open_ctree+0x1392/0x1ac0
[   87.471343]  [<ffffffff812b0901>] ? disk_name+0x61/0xc0
[   87.472709]  [<ffffffff811e8666>] btrfs_mount+0x5b6/0x6a0
[   87.474065]  [<ffffffff8112cbcb>] ? pcpu_alloc+0x8bb/0x9d0
[   87.475400]  [<ffffffff812c3a38>] ? ida_get_new_above+0x218/0x2a0
[   87.476729]  [<ffffffff8116fce3>] mount_fs+0x43/0x1b0
[   87.478048]  [<ffffffff8112ccf0>] ? __alloc_percpu+0x10/0x20
[   87.479364]  [<ffffffff81189e70>] vfs_kern_mount+0x70/0x100
[   87.480679]  [<ffffffff8118a394>] do_kern_mount+0x54/0x110
[   87.482187]  [<ffffffff8118bc7a>] do_mount+0x26a/0x850
[   87.483551]  [<ffffffff811274bb>] ? strndup_user+0x5b/0x80
[   87.484863]  [<ffffffff8118c39d>] sys_mount+0x8d/0xe0
[   87.486134]  [<ffffffff814d15e9>] system_call_fastpath+0x16/0x1b
[   87.487378] ---[ end trace 63bca69dcc9ebeb8 ]---
[   87.488578] io error, failed mirror 0
[   87.820244] parent transid verify failed on 195091890176 wanted
168040 found 168229
[   87.821396] failed mirror was 0
[   87.822499] ------------[ cut here ]------------
[   87.823624] WARNING: at fs/btrfs/disk-io.c:394
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160()
[   87.824776] Hardware name: P5Q SE/R
[   87.825897] Modules linked in: fuse ext4 crc16 jbd2 mbcache rt73usb
rt2x00usb snd_hda_codec_hdmi crc_itu_t rt2x00lib usbhid uvcvideo hid
videobuf2_vmalloc videobuf2_memops videobuf2_core arc4 stv0299
snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm
snd_page_alloc snd_timer snd rtl8180 eeprom_93cx6 mac80211 budget_av
budget_core cfg80211 ttpci_eeprom radeon saa7146_vv i2c_algo_bit atl1e
soundcore rfkill saa7146 drm_kms_helper dvb_core videobuf_dma_sg
videobuf_core videodev evdev media ttm drm psmouse serio_raw iTCO_wdt
iTCO_vendor_support button coretemp intel_agp i2c_i801 microcode
intel_gtt processor i2c_core asus_atk0110 autofs4 uhci_hcd ehci_hcd
usbcore usb_common sd_mod ahci sr_mod cdrom libahci pata_marvell
libata scsi_mod
[   87.831175] Pid: 735, comm: mount Tainted: G        W
3.4.0-rc2-mainline #5
[   87.832513] Call Trace:
[   87.833824]  [<ffffffff810515ff>] warn_slowpath_common+0x7f/0xc0
[   87.835136]  [<ffffffff8105165a>] warn_slowpath_null+0x1a/0x20
[   87.836445]  [<ffffffff81208aaa>]
btree_read_extent_buffer_pages.constprop.111+0x13a/0x160
[   87.837770]  [<ffffffff8120928a>] read_tree_block+0x3a/0x50
[   87.839178]  [<ffffffff811eec73>] read_block_for_search.isra.33+0x1f=
3/0x3a0
[   87.840799]  [<ffffffff811ee39b>] ?
generic_bin_search.constprop.35+0x6b/0x180
[   87.842409]  [<ffffffff811f107c>] btrfs_search_slot+0x3ec/0x900
[   87.844082]  [<ffffffff81206a00>] ? verify_parent_transid+0x160/0x16=
0
[   87.845743]  [<ffffffff8120089f>] btrfs_read_block_groups+0xdf/0x660
[   87.847231]  [<ffffffff811f43f9>] ? update_space_info+0x199/0x1f0
[   87.848757]  [<ffffffff8120ce12>] open_ctree+0x1392/0x1ac0
[   87.850403]  [<ffffffff812b0901>] ? disk_name+0x61/0xc0
[   87.851784]  [<ffffffff811e8666>] btrfs_mount+0x5b6/0x6a0
[   87.853314]  [<ffffffff8112cbcb>] ? pcpu_alloc+0x8bb/0x9d0
[   87.854756]  [<ffffffff812c3a38>] ? ida_get_new_above+0x218/0x2a0
[   87.856136]  [<ffffffff8116fce3>] mount_fs+0x43/0x1b0
[   87.857494]  [<ffffffff8112ccf0>] ? __alloc_percpu+0x10/0x20
[   87.858885]  [<ffffffff81189e70>] vfs_kern_mount+0x70/0x100
[   87.860213]  [<ffffffff8118a394>] do_kern_mount+0x54/0x110
[   87.861557]  [<ffffffff8118bc7a>] do_mount+0x26a/0x850
[   87.862857]  [<ffffffff811274bb>] ? strndup_user+0x5b/0x80
[   87.864167]  [<ffffffff8118c39d>] sys_mount+0x8d/0xe0
[   87.865451]  [<ffffffff814d15e9>] system_call_fastpath+0x16/0x1b
[   87.866689] ---[ end trace 63bca69dcc9ebeb9 ]---
[   87.867886] io error, failed mirror 0
[   87.869054] ------------[ cut here ]------------
[   87.870018] kernel BUG at fs/btrfs/extent_io.c:1890!
[   87.870018] invalid opcode: 0000 [#1] PREEMPT SMP
[   87.870018] CPU 1
[   87.870018] Modules linked in: fuse ext4 crc16 jbd2 mbcache rt73usb
rt2x00usb snd_hda_codec_hdmi crc_itu_t rt2x00lib usbhid uvcvideo hid
videobuf2_vmalloc videobuf2_memops videobuf2_core arc4 stv0299
snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm
snd_page_alloc snd_timer snd rtl8180 eeprom_93cx6 mac80211 budget_av
budget_core cfg80211 ttpci_eeprom radeon saa7146_vv i2c_algo_bit atl1e
soundcore rfkill saa7146 drm_kms_helper dvb_core videobuf_dma_sg
videobuf_core videodev evdev media ttm drm psmouse serio_raw iTCO_wdt
iTCO_vendor_support button coretemp intel_agp i2c_i801 microcode
intel_gtt processor i2c_core asus_atk0110 autofs4 uhci_hcd ehci_hcd
usbcore usb_common sd_mod ahci sr_mod cdrom libahci pata_marvell
libata scsi_mod
[   87.870018]
[   87.870018] Pid: 735, comm: mount Tainted: G        W
3.4.0-rc2-mainline #5 System manufacturer P5Q SE/R/P5Q SE/R
[   87.870018] RIP: 0010:[<ffffffff8123207f>]  [<ffffffff8123207f>]
repair_io_failure+0x17f/0x1c0
[   87.870018] RSP: 0018:ffff88011705b7f8  EFLAGS: 00010246
[   87.870018] RAX: ffff88011705b828 RBX: 0000002d6c620000 RCX: 0000002=
d6c620000
[   87.870018] RDX: 0000000000001000 RSI: 0000002d6c620000 RDI: ffff880=
11f8f4108
[   87.870018] RBP: ffff88011705b868 R08: ffffea00045c6e80 R09: 0000000=
000000000
[   87.870018] R10: 0000000000000001 R11: 0000000000aaaaaa R12: 0000000=
000001000
[   87.870018] R13: ffffea00045c6e80 R14: ffff88011f8f4108 R15: 0000000=
000000000
[   87.870018] FS:  00007f2dd7d14740(0000) GS:ffff88012fc80000(0000)
knlGS:0000000000000000
[   87.870018] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   87.870018] CR2: 00007fd78eee0000 CR3: 000000011703d000 CR4: 0000000=
0000007e0
[   87.870018] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000=
000000000
[   87.870018] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000=
000000400
[   87.870018] Process mount (pid: 735, threadinfo ffff88011705a000,
task ffff880119284770)
[   87.870018] Stack:
[   87.870018]  ffff00205d363838 0000002d6c620000 0000000000000000
0000000000000000
[   87.870018]  ffff880100000000 000000002def0000 ffff88011705b828
ffff88011705b828
[   87.870018]  0000000000000000 0000002d6c620000 0000000000000000
ffff88011f8f4108
[   87.870018] Call Trace:
[   87.870018]  [<ffffffff81232a12>] repair_eb_io_failure+0x82/0xa0
[   87.870018]  [<ffffffff81208a82>]
btree_read_extent_buffer_pages.constprop.111+0x112/0x160
[   87.870018]  [<ffffffff8120928a>] read_tree_block+0x3a/0x50
[   87.870018]  [<ffffffff811eec73>] read_block_for_search.isra.33+0x1f=
3/0x3a0
[   87.870018]  [<ffffffff811ee39b>] ?
generic_bin_search.constprop.35+0x6b/0x180
[   87.870018]  [<ffffffff811f107c>] btrfs_search_slot+0x3ec/0x900
[   87.870018]  [<ffffffff81206a00>] ? verify_parent_transid+0x160/0x16=
0
[   87.870018]  [<ffffffff8120089f>] btrfs_read_block_groups+0xdf/0x660
[   87.870018]  [<ffffffff811f43f9>] ? update_space_info+0x199/0x1f0
[   87.870018]  [<ffffffff8120ce12>] open_ctree+0x1392/0x1ac0
[   87.870018]  [<ffffffff812b0901>] ? disk_name+0x61/0xc0
[   87.870018]  [<ffffffff811e8666>] btrfs_mount+0x5b6/0x6a0
[   87.870018]  [<ffffffff8112cbcb>] ? pcpu_alloc+0x8bb/0x9d0
[   87.870018]  [<ffffffff812c3a38>] ? ida_get_new_above+0x218/0x2a0
[   87.870018]  [<ffffffff8116fce3>] mount_fs+0x43/0x1b0
[   87.870018]  [<ffffffff8112ccf0>] ? __alloc_percpu+0x10/0x20
[   87.870018]  [<ffffffff81189e70>] vfs_kern_mount+0x70/0x100
[   87.870018]  [<ffffffff8118a394>] do_kern_mount+0x54/0x110
[   87.870018]  [<ffffffff8118bc7a>] do_mount+0x26a/0x850
[   87.870018]  [<ffffffff811274bb>] ? strndup_user+0x5b/0x80
[   87.870018]  [<ffffffff8118c39d>] sys_mount+0x8d/0xe0
[   87.870018]  [<ffffffff814d15e9>] system_call_fastpath+0x16/0x1b
[   87.870018] Code: e5 f6 ff b8 fb ff ff ff 48 8b 5d d8 4c 8b 65 e0
4c 8b 6d e8 4c 8b 75 f0 4c 8b 7d f8 c9 c3 66 0f 1f 44 00 00 b8 fb ff
ff ff eb dd <0f> 0b 0f 0b 49 8b 45 08 49 8b 8f 88 00 00 00 4d 89 f0 48
8b 55
[   87.870018] RIP  [<ffffffff8123207f>] repair_io_failure+0x17f/0x1c0
[   87.870018]  RSP <ffff88011705b7f8>
[   87.935444] ---[ end trace 63bca69dcc9ebeba ]---
--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-12 21:56           ` Francesco Cepparo
@ 2012-04-13 14:45             ` Josef Bacik
  2012-04-14  0:06               ` Francesco Cepparo
  0 siblings, 1 reply; 10+ messages in thread
From: Josef Bacik @ 2012-04-13 14:45 UTC (permalink / raw)
  To: Francesco Cepparo; +Cc: Josef Bacik, chris.mason, linux-btrfs

On Thu, Apr 12, 2012 at 09:56:30PM +0000, Francesco Cepparo wrote:
> On Thu, Apr 12, 2012 at 6:20 PM, Josef Bacik <josef@redhat.com> wrote=
:
> > On Thu, Apr 12, 2012 at 02:15:25PM -0400, Chris Mason wrote:
> >> On Thu, Apr 12, 2012 at 02:08:37PM -0400, Josef Bacik wrote:
> >> > On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wrot=
e:
> >> > > I tried your patch but unfortunately the kernel still gives me=
 the
> >> > > same error message :(
> >> >
> >> > Weird, will you apply this patch on top of the one I sent you an=
d send me the
> >> > dmesg when it panics again? =A0Thanks,
> >> >
> >> > Josef
> >> >
> >> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> > index 2a3ddd2..51efb58 100644
> >> > --- a/fs/btrfs/disk-io.c
> >> > +++ b/fs/btrfs/disk-io.c
> >> > @@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page =
*page, int failed_mirror)
> >> >
> >> > =A0 =A0 eb =3D (struct extent_buffer *)page->private;
> >> > =A0 =A0 set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
> >> > + =A0 WARN_ON(!failed_mirror);
> >> > + =A0 printk(KERN_ERR "io error, failed mirror %d\n");
> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^
> >>
> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , failed_mirror
> >>
> >
> > pfft compiling debug patches before sending them out is for losers,
> >
> > Josef
>=20
> I applied your second patch on top of the first one but the dmesg
> output stays the same.... before you ask, I'm sure I'm compiling the
> kernel correctly, as putting the WARN_ON(!failed_mirror) inside the i=
f
> (!failed_mirror) on line 391 correctly prints the warnings... I'm not
> sure whether the warnings generated in that place are of any interest
> but showing them anyway can't hurt:
>=20

Oh hah I see what's happening, unapply the last patch I sent you (leave=
 the
first one in place) and apply this one, it should fix the problem.  Tha=
nks,

Josef

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2a3ddd2..dc52f3f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -390,8 +390,7 @@ static int btree_read_extent_buffer_pages(struct bt=
rfs_root *root,
=20
 		if (!failed_mirror) {
 			failed =3D 1;
-			printk(KERN_ERR "failed mirror was %d\n", eb->failed_mirror);
-			failed_mirror =3D eb->failed_mirror;
+			failed_mirror =3D eb->read_mirror;
 		}
=20
 		mirror_num++;
@@ -564,7 +563,7 @@ struct extent_buffer *find_eb_for_page(struct exten=
t_io_tree *tree,
 }
=20
 static int btree_readpage_end_io_hook(struct page *page, u64 start, u6=
4 end,
-			       struct extent_state *state)
+			       struct extent_state *state, int mirror)
 {
 	struct extent_io_tree *tree;
 	u64 found_start;
@@ -589,6 +588,7 @@ static int btree_readpage_end_io_hook(struct page *=
page, u64 start, u64 end,
 	if (!reads_done)
 		goto err;
=20
+	eb->read_mirror =3D mirror;
 	if (test_bit(EXTENT_BUFFER_IOERR, &eb->bflags)) {
 		ret =3D -EIO;
 		goto err;
@@ -652,7 +652,6 @@ static int btree_io_failed_hook(struct page *page, =
int failed_mirror)
=20
 	eb =3D (struct extent_buffer *)page->private;
 	set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
-	eb->failed_mirror =3D failed_mirror;
 	if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
 		btree_readahead_hook(root, eb, eb->start, -EIO);
 	return -EIO;	/* we fixed nothing */
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 0c3ec00..7c501d3 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2297,7 +2297,7 @@ static void end_bio_extent_readpage(struct bio *b=
io, int err)
 	u64 start;
 	u64 end;
 	int whole_page;
-	int failed_mirror;
+	int mirror;
 	int ret;
=20
 	if (err)
@@ -2336,20 +2336,18 @@ static void end_bio_extent_readpage(struct bio =
*bio, int err)
 		}
 		spin_unlock(&tree->lock);
=20
+		mirror =3D (int)(unsigned long)bio->bi_bdev;
 		if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) {
 			ret =3D tree->ops->readpage_end_io_hook(page, start, end,
-							      state);
+							      state, mirror);
 			if (ret)
 				uptodate =3D 0;
 			else
 				clean_io_failure(start, page);
 		}
=20
-		if (!uptodate)
-			failed_mirror =3D (int)(unsigned long)bio->bi_bdev;
-
 		if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) {
-			ret =3D tree->ops->readpage_io_failed_hook(page, failed_mirror);
+			ret =3D tree->ops->readpage_io_failed_hook(page, mirror);
 			if (!ret && !err &&
 			    test_bit(BIO_UPTODATE, &bio->bi_flags))
 				uptodate =3D 1;
@@ -2364,8 +2362,7 @@ static void end_bio_extent_readpage(struct bio *b=
io, int err)
 			 * can't handle the error it will return -EIO and we
 			 * remain responsible for that page.
 			 */
-			ret =3D bio_readpage_error(bio, page, start, end,
-							failed_mirror, NULL);
+			ret =3D bio_readpage_error(bio, page, start, end, mirror, NULL);
 			if (ret =3D=3D 0) {
 				uptodate =3D
 					test_bit(BIO_UPTODATE, &bio->bi_flags);
@@ -4458,7 +4455,7 @@ int read_extent_buffer_pages(struct extent_io_tre=
e *tree,
 	}
=20
 	clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
-	eb->failed_mirror =3D 0;
+	eb->read_mirror =3D 0;
 	atomic_set(&eb->io_pages, num_reads);
 	for (i =3D start_i; i < num_pages; i++) {
 		page =3D extent_buffer_page(eb, i);
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index faf10eb..b516c3b 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -79,7 +79,7 @@ struct extent_io_ops {
 					u64 start, u64 end,
 				       struct extent_state *state);
 	int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end,
-				    struct extent_state *state);
+				    struct extent_state *state, int mirror);
 	int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
 				      struct extent_state *state, int uptodate);
 	void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
@@ -135,7 +135,7 @@ struct extent_buffer {
 	spinlock_t refs_lock;
 	atomic_t refs;
 	atomic_t io_pages;
-	int failed_mirror;
+	int read_mirror;
 	struct list_head leak_list;
 	struct rcu_head rcu_head;
 	pid_t lock_owner;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 261021c..77c2b03 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1947,7 +1947,7 @@ static int btrfs_writepage_end_io_hook(struct pag=
e *page, u64 start, u64 end,
  * extent_io.c will try to find good copies for us.
  */
 static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u6=
4 end,
-			       struct extent_state *state)
+			       struct extent_state *state, int mirror)
 {
 	size_t offset =3D start - ((u64)page->index << PAGE_CACHE_SHIFT);
 	struct inode *inode =3D page->mapping->host;
--
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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-13 14:45             ` Josef Bacik
@ 2012-04-14  0:06               ` Francesco Cepparo
  2012-04-16 13:34                 ` Josef Bacik
  0 siblings, 1 reply; 10+ messages in thread
From: Francesco Cepparo @ 2012-04-14  0:06 UTC (permalink / raw)
  To: Josef Bacik, Chris Mason, linux-btrfs

That did it :) the kernel now fails the mounting gracefully as it did b=
efore. :)
Thanks!



On Fri, Apr 13, 2012 at 2:45 PM, Josef Bacik <josef@redhat.com> wrote:
> On Thu, Apr 12, 2012 at 09:56:30PM +0000, Francesco Cepparo wrote:
>> On Thu, Apr 12, 2012 at 6:20 PM, Josef Bacik <josef@redhat.com> wrot=
e:
>> > On Thu, Apr 12, 2012 at 02:15:25PM -0400, Chris Mason wrote:
>> >> On Thu, Apr 12, 2012 at 02:08:37PM -0400, Josef Bacik wrote:
>> >> > On Wed, Apr 11, 2012 at 11:59:43PM +0000, Francesco Cepparo wro=
te:
>> >> > > I tried your patch but unfortunately the kernel still gives m=
e the
>> >> > > same error message :(
>> >> >
>> >> > Weird, will you apply this patch on top of the one I sent you a=
nd send me the
>> >> > dmesg when it panics again? =A0Thanks,
>> >> >
>> >> > Josef
>> >> >
>> >> > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> >> > index 2a3ddd2..51efb58 100644
>> >> > --- a/fs/btrfs/disk-io.c
>> >> > +++ b/fs/btrfs/disk-io.c
>> >> > @@ -652,6 +652,8 @@ static int btree_io_failed_hook(struct page=
 *page, int failed_mirror)
>> >> >
>> >> > =A0 =A0 eb =3D (struct extent_buffer *)page->private;
>> >> > =A0 =A0 set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
>> >> > + =A0 WARN_ON(!failed_mirror);
>> >> > + =A0 printk(KERN_ERR "io error, failed mirror %d\n");
>> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^
>> >>
>> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 , failed_mirror
>> >>
>> >
>> > pfft compiling debug patches before sending them out is for losers=
,
>> >
>> > Josef
>>
>> I applied your second patch on top of the first one but the dmesg
>> output stays the same.... before you ask, I'm sure I'm compiling the
>> kernel correctly, as putting the WARN_ON(!failed_mirror) inside the =
if
>> (!failed_mirror) on line 391 correctly prints the warnings... I'm no=
t
>> sure whether the warnings generated in that place are of any interes=
t
>> but showing them anyway can't hurt:
>>
>
> Oh hah I see what's happening, unapply the last patch I sent you (lea=
ve the
> first one in place) and apply this one, it should fix the problem. =A0=
Thanks,
>
> Josef
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 2a3ddd2..dc52f3f 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -390,8 +390,7 @@ static int btree_read_extent_buffer_pages(struct =
btrfs_root *root,
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!failed_mirror) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0failed =3D 1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "failed=
 mirror was %d\n", eb->failed_mirror);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 failed_mirror =3D eb->f=
ailed_mirror;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 failed_mirror =3D eb->r=
ead_mirror;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mirror_num++;
> @@ -564,7 +563,7 @@ struct extent_buffer *find_eb_for_page(struct ext=
ent_io_tree *tree,
> =A0}
>
> =A0static int btree_readpage_end_io_hook(struct page *page, u64 start=
, u64 end,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct e=
xtent_state *state)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct e=
xtent_state *state, int mirror)
> =A0{
> =A0 =A0 =A0 =A0struct extent_io_tree *tree;
> =A0 =A0 =A0 =A0u64 found_start;
> @@ -589,6 +588,7 @@ static int btree_readpage_end_io_hook(struct page=
 *page, u64 start, u64 end,
> =A0 =A0 =A0 =A0if (!reads_done)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto err;
>
> + =A0 =A0 =A0 eb->read_mirror =3D mirror;
> =A0 =A0 =A0 =A0if (test_bit(EXTENT_BUFFER_IOERR, &eb->bflags)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D -EIO;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto err;
> @@ -652,7 +652,6 @@ static int btree_io_failed_hook(struct page *page=
, int failed_mirror)
>
> =A0 =A0 =A0 =A0eb =3D (struct extent_buffer *)page->private;
> =A0 =A0 =A0 =A0set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
> - =A0 =A0 =A0 eb->failed_mirror =3D failed_mirror;
> =A0 =A0 =A0 =A0if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->b=
flags))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0btree_readahead_hook(root, eb, eb->sta=
rt, -EIO);
> =A0 =A0 =A0 =A0return -EIO; =A0 =A0/* we fixed nothing */
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 0c3ec00..7c501d3 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2297,7 +2297,7 @@ static void end_bio_extent_readpage(struct bio =
*bio, int err)
> =A0 =A0 =A0 =A0u64 start;
> =A0 =A0 =A0 =A0u64 end;
> =A0 =A0 =A0 =A0int whole_page;
> - =A0 =A0 =A0 int failed_mirror;
> + =A0 =A0 =A0 int mirror;
> =A0 =A0 =A0 =A0int ret;
>
> =A0 =A0 =A0 =A0if (err)
> @@ -2336,20 +2336,18 @@ static void end_bio_extent_readpage(struct bi=
o *bio, int err)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_unlock(&tree->lock);
>
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mirror =3D (int)(unsigned long)bio->bi_=
bdev;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (uptodate && tree->ops && tree->ops=
->readpage_end_io_hook) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ret =3D tree->ops->rea=
dpage_end_io_hook(page, start, end,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 state);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 state, mirror);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ret)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uptoda=
te =3D 0;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0clean_=
io_failure(start, page);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!uptodate)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 failed_mirror =3D (int)=
(unsigned long)bio->bi_bdev;
> -
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!uptodate && tree->ops && tree->op=
s->readpage_io_failed_hook) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D tree->ops->read=
page_io_failed_hook(page, failed_mirror);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D tree->ops->read=
page_io_failed_hook(page, mirror);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!ret && !err &&
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0test_bit(BIO_U=
PTODATE, &bio->bi_flags))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uptoda=
te =3D 1;
> @@ -2364,8 +2362,7 @@ static void end_bio_extent_readpage(struct bio =
*bio, int err)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * can't handle the er=
ror it will return -EIO and we
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * remain responsible =
for that page.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D bio_readpage_er=
ror(bio, page, start, end,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 failed_mirror, NULL);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D bio_readpage_er=
ror(bio, page, start, end, mirror, NULL);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ret =3D=3D 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uptoda=
te =3D
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0test_bit(BIO_UPTODATE, &bio->bi_flags);
> @@ -4458,7 +4455,7 @@ int read_extent_buffer_pages(struct extent_io_t=
ree *tree,
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
> - =A0 =A0 =A0 eb->failed_mirror =3D 0;
> + =A0 =A0 =A0 eb->read_mirror =3D 0;
> =A0 =A0 =A0 =A0atomic_set(&eb->io_pages, num_reads);
> =A0 =A0 =A0 =A0for (i =3D start_i; i < num_pages; i++) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0page =3D extent_buffer_page(eb, i);
> diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
> index faf10eb..b516c3b 100644
> --- a/fs/btrfs/extent_io.h
> +++ b/fs/btrfs/extent_io.h
> @@ -79,7 +79,7 @@ struct extent_io_ops {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0u64 start, u64 end,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 struct extent_state *state);
> =A0 =A0 =A0 =A0int (*readpage_end_io_hook)(struct page *page, u64 sta=
rt, u64 end,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 struct extent_state *state);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 struct extent_state *state, int mirror);
> =A0 =A0 =A0 =A0int (*writepage_end_io_hook)(struct page *page, u64 st=
art, u64 end,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0struct extent_state *state, int uptodate);
> =A0 =A0 =A0 =A0void (*set_bit_hook)(struct inode *inode, struct exten=
t_state *state,
> @@ -135,7 +135,7 @@ struct extent_buffer {
> =A0 =A0 =A0 =A0spinlock_t refs_lock;
> =A0 =A0 =A0 =A0atomic_t refs;
> =A0 =A0 =A0 =A0atomic_t io_pages;
> - =A0 =A0 =A0 int failed_mirror;
> + =A0 =A0 =A0 int read_mirror;
> =A0 =A0 =A0 =A0struct list_head leak_list;
> =A0 =A0 =A0 =A0struct rcu_head rcu_head;
> =A0 =A0 =A0 =A0pid_t lock_owner;
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 261021c..77c2b03 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1947,7 +1947,7 @@ static int btrfs_writepage_end_io_hook(struct p=
age *page, u64 start, u64 end,
> =A0* extent_io.c will try to find good copies for us.
> =A0*/
> =A0static int btrfs_readpage_end_io_hook(struct page *page, u64 start=
, u64 end,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct e=
xtent_state *state)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct e=
xtent_state *state, int mirror)
> =A0{
> =A0 =A0 =A0 =A0size_t offset =3D start - ((u64)page->index << PAGE_CA=
CHE_SHIFT);
> =A0 =A0 =A0 =A0struct inode *inode =3D page->mapping->host;
--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kernel BUG at fs/btrfs/extent_io.c:1890!
  2012-04-14  0:06               ` Francesco Cepparo
@ 2012-04-16 13:34                 ` Josef Bacik
  0 siblings, 0 replies; 10+ messages in thread
From: Josef Bacik @ 2012-04-16 13:34 UTC (permalink / raw)
  To: Francesco Cepparo; +Cc: Josef Bacik, Chris Mason, linux-btrfs

On Sat, Apr 14, 2012 at 12:06:13AM +0000, Francesco Cepparo wrote:
> That did it :) the kernel now fails the mounting gracefully as it did before. :)
> Thanks!

Perfect! :)

Josef 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-04-16 13:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 14:44 kernel BUG at fs/btrfs/extent_io.c:1890! Francesco Cepparo
2012-04-11 15:01 ` Josef Bacik
2012-04-11 23:59   ` Francesco Cepparo
2012-04-12 18:08     ` Josef Bacik
2012-04-12 18:15       ` Chris Mason
2012-04-12 18:20         ` Josef Bacik
2012-04-12 21:56           ` Francesco Cepparo
2012-04-13 14:45             ` Josef Bacik
2012-04-14  0:06               ` Francesco Cepparo
2012-04-16 13:34                 ` Josef Bacik

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.