Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-16 Thread Qu Wenruo



At 06/17/2016 01:22 AM, Paul Verreth wrote:

Hello.

New test:

I booted from a live USB-stick with all updates installed
(4.4.0-21-generic), and after mount of the btrfs filesystem, the
balance continued, and a bug appeared in kern.log.

The filesystem turned readonly
An important directory was missing.


Jun 16 17:38:08 ubuntu kernel: [  195.482907] BTRFS info (device
sdb5): enabling auto recovery
Jun 16 17:38:08 ubuntu kernel: [  195.482914] BTRFS info (device
sdb5): disk space caching is enabled
Jun 16 17:38:08 ubuntu kernel: [  195.488335] BTRFS info (device
sdb5): bdev /dev/sdb5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
Jun 16 17:38:08 ubuntu kernel: [  195.488340] BTRFS info (device
sdb5): bdev /dev/sda5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0


The corrupt from kernel message is quite dangerous.
I would assume there is some thing wrong with that device.

Maybe that's the problem leading to the BUG_ON.


And I also found that in your initial report, your extent tree seems to 
be already corrupted.


Just as Chris said, it's a good idea to see how btrfsck complains about 
your fs.


I assume it's already heavily corrupted though.

Thanks,
Qu


Jun 16 17:38:08 ubuntu kernel: [  195.559146] BTRFS: detected SSD
devices, enabling SSD mode
Jun 16 17:38:08 ubuntu kernel: [  195.560224] BTRFS: checking UUID tree
Jun 16 17:38:08 ubuntu kernel: [  195.560226] BTRFS info (device
sdb5): continuing balance
Jun 16 17:38:08 ubuntu kernel: [  195.560229] BTRFS info (device
sdb5): force reducing metadata integrity
Jun 16 17:38:08 ubuntu kernel: [  195.583979] BTRFS info (device
sdb5): relocating block group 297447456768 flags 20
Jun 16 17:38:12 ubuntu kernel: [  199.340273] [ cut here
]
Jun 16 17:38:12 ubuntu kernel: [  199.340290] kernel BUG at
/build/linux-Ay7j_C/linux-4.4.0/fs/btrfs/relocation.c:2683!
Jun 16 17:38:12 ubuntu kernel: [  199.340308] invalid opcode:  [#1] SMP
Jun 16 17:38:12 ubuntu kernel: [  199.340319] Modules linked in:
intel_rapl snd_hda_codec_realtek x86_pkg_temp_thermal intel_powerclamp
snd_hda_codec_hdmi snd_hda_codec_generic coretemp snd_hda_intel
snd_hda_codec kvm snd_hda_core snd_hwdep snd_pcm irqbypass
snd_seq_midi snd_seq_midi_event crct10dif_pclmul snd_rawmidi
crc32_pclmul snd_seq aesni_intel eeepc_wmi snd_seq_device aes_x86_64
asus_wmi input_leds lrw snd_timer sparse_keymap mei_me lpc_ich
serio_raw mei snd gf128mul 8250_fintek soundcore glue_helper shpchp
ablk_helper cryptd tpm_infineon mac_hid parport_pc ppdev lp parport
autofs4 squashfs overlay nls_utf8 isofs hid_generic usbhid hid uas
usb_storage btrfs xor raid6_pq nls_iso8859_1 dm_mirror dm_region_hash
dm_log i915 mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea
sysfillrect sysimgblt e1000e fb_sys_fops drm ahci ptp libahci pps_core
fjes wmi video
Jun 16 17:38:12 ubuntu kernel: [  199.340540] CPU: 1 PID: 7602 Comm:
btrfs-balance Not tainted 4.4.0-21-generic #37-Ubuntu
Jun 16 17:38:12 ubuntu kernel: [  199.340558] Hardware name: ASUS All
Series/Z87-PLUS, BIOS 1707 12/13/2013
Jun 16 17:38:12 ubuntu kernel: [  199.340573] task: 8804173b3700
ti: 8803ec36c000 task.ti: 8803ec36c000
Jun 16 17:38:12 ubuntu kernel: [  199.340589] RIP:
0010:[]  []
do_relocation+0x515/0x520 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340631] RSP:
0018:8803ec36fb00  EFLAGS: 00010202
Jun 16 17:38:12 ubuntu kernel: [  199.340643] RAX: 0001
RBX: 8800bc72ca80 RCX: 
Jun 16 17:38:12 ubuntu kernel: [  199.340658] RDX: 
RSI:  RDI: 
Jun 16 17:38:12 ubuntu kernel: [  199.340674] RBP: 8803ec36fbb8
R08: 8803ec36fab4 R09: 1600
Jun 16 17:38:12 ubuntu kernel: [  199.340689] R10: 0002
R11: 0045 R12: 8803ec33f680
Jun 16 17:38:12 ubuntu kernel: [  199.340704] R13: 88041b11
R14: 88040026e180 R15: 0001
Jun 16 17:38:12 ubuntu kernel: [  199.340720] FS:
() GS:88042fa4()
knlGS:
Jun 16 17:38:12 ubuntu kernel: [  199.340738] CS:  0010 DS:  ES:
 CR0: 80050033
Jun 16 17:38:12 ubuntu kernel: [  199.340750] CR2: 01263860
CR3: 01e0a000 CR4: 001406e0
Jun 16 17:38:12 ubuntu kernel: [  199.340766] DR0: 
DR1:  DR2: 
Jun 16 17:38:12 ubuntu kernel: [  199.340781] DR3: 
DR6: fffe0ff0 DR7: 0400
Jun 16 17:38:12 ubuntu kernel: [  199.340796] Stack:
Jun 16 17:38:12 ubuntu kernel: [  199.340801]  
880405bf7920 880415279870 8803ec33f6c0
Jun 16 17:38:12 ubuntu kernel: [  199.340820]  880405bf7800
88040026ece0 0001 8803ed251be0
Jun 16 17:38:12 ubuntu kernel: [  199.340839]  8803ec36fb40
8803ec36fb40 8800c4956780 88040026e180
Jun 16 17:38:12 ubuntu kernel: [  199.340858] Call Trace:
Jun 16 17:38:12 ubuntu kernel: [  199.340873]  [] ?
btrfs_block_rsv_refill+0x37/0xb0 [bt

Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-16 Thread Chris Murphy
On Wed, Jun 15, 2016 at 12:29 AM, Paul Verreth  wrote:
> Dear all.
>
> When I download a video using  Firefox DownloadHelper addon, the
> filesystem suddenly turns read only. Not a coincedence, I tried it
> several times, and it happened every time again
>
> Info:
> Linux wolfgang 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC
> 2016 x86_64 x86_64 x86_64 GNU/Linux
>
> btrfs --version
> btrfs-progs v4.0

I'm curious what you get from btrfs check (without --repair) with a
recent btrfs-progs, i.e. ideally a 4.5 version.

Fedora 24 is a go as of today, and the smallest image with btrfs-progs
4.5.2 on it is this 438M image:

http://dl.fedoraproject.org/pub/alt/stage/24_RC-1.2/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-24-1.2.iso

dd that to a USB stick and boot, at the boot menu pick
Troubleshooting, then pick Rescue a Fedora system. At the menu pick
skip to shell. Here you can run:

lsblk
btrfs check /dev/sdXY > btrfscheck.txt

That won't output 100% to that file but most of it will go there. If
you have a wired network connection it should be up already, otherwise
you're messing around with nmcli to get it up. scp it somewhere or if
the file is small enough you can 'fpaste btrfscheck.txt' and it'll
spit back a URL where it uploaded that file.




-- 
Chris Murphy
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-16 Thread Paul Verreth
Hello.


After rescue:

root@ubuntu:/mnt# btrfs rescue chunk-recover -v /dev/sda5
All Devices:
Device: id = 2, name = /dev/sdb5
Device: id = 1, name = /dev/sda5

Scanning: 184371421184 in dev0, 184315789312 in
dev1chunk-recover.c:129: process_extent_buffer: Assertion
`exist->nmirrors >= BTRFS_MAX_MIRRORS` failed.
btrfs[0x429b3a]
btrfs[0x42aa3c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76fa)[0x7f477ff086fa]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f477fc3eb5d]
root@ubuntu:/mnt# btrfs rescue super-recover -v /dev/sda5
All Devices:
Device: id = 2, name = /dev/sdb5
Device: id = 1, name = /dev/sda5

Before Recovering:
[All good supers]:
device name = /dev/sdb5
superblock bytenr = 65536

device name = /dev/sdb5
superblock bytenr = 67108864

device name = /dev/sdb5
superblock bytenr = 274877906944

device name = /dev/sda5
superblock bytenr = 65536

device name = /dev/sda5
superblock bytenr = 67108864

device name = /dev/sda5
superblock bytenr = 274877906944

[All bad supers]:

All supers are valid, no need to recover


No messages in kern.log

Kind regards.

2016-06-16 19:22 GMT+02:00 Paul Verreth :
> Hello.
>
> New test:
>
> I booted from a live USB-stick with all updates installed
> (4.4.0-21-generic), and after mount of the btrfs filesystem, the
> balance continued, and a bug appeared in kern.log.
>
> The filesystem turned readonly
> An important directory was missing.
>
>
> Jun 16 17:38:08 ubuntu kernel: [  195.482907] BTRFS info (device
> sdb5): enabling auto recovery
> Jun 16 17:38:08 ubuntu kernel: [  195.482914] BTRFS info (device
> sdb5): disk space caching is enabled
> Jun 16 17:38:08 ubuntu kernel: [  195.488335] BTRFS info (device
> sdb5): bdev /dev/sdb5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
> Jun 16 17:38:08 ubuntu kernel: [  195.488340] BTRFS info (device
> sdb5): bdev /dev/sda5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
> Jun 16 17:38:08 ubuntu kernel: [  195.559146] BTRFS: detected SSD
> devices, enabling SSD mode
> Jun 16 17:38:08 ubuntu kernel: [  195.560224] BTRFS: checking UUID tree
> Jun 16 17:38:08 ubuntu kernel: [  195.560226] BTRFS info (device
> sdb5): continuing balance
> Jun 16 17:38:08 ubuntu kernel: [  195.560229] BTRFS info (device
> sdb5): force reducing metadata integrity
> Jun 16 17:38:08 ubuntu kernel: [  195.583979] BTRFS info (device
> sdb5): relocating block group 297447456768 flags 20
> Jun 16 17:38:12 ubuntu kernel: [  199.340273] [ cut here
> ]
> Jun 16 17:38:12 ubuntu kernel: [  199.340290] kernel BUG at
> /build/linux-Ay7j_C/linux-4.4.0/fs/btrfs/relocation.c:2683!
> Jun 16 17:38:12 ubuntu kernel: [  199.340308] invalid opcode:  [#1] SMP
> Jun 16 17:38:12 ubuntu kernel: [  199.340319] Modules linked in:
> intel_rapl snd_hda_codec_realtek x86_pkg_temp_thermal intel_powerclamp
> snd_hda_codec_hdmi snd_hda_codec_generic coretemp snd_hda_intel
> snd_hda_codec kvm snd_hda_core snd_hwdep snd_pcm irqbypass
> snd_seq_midi snd_seq_midi_event crct10dif_pclmul snd_rawmidi
> crc32_pclmul snd_seq aesni_intel eeepc_wmi snd_seq_device aes_x86_64
> asus_wmi input_leds lrw snd_timer sparse_keymap mei_me lpc_ich
> serio_raw mei snd gf128mul 8250_fintek soundcore glue_helper shpchp
> ablk_helper cryptd tpm_infineon mac_hid parport_pc ppdev lp parport
> autofs4 squashfs overlay nls_utf8 isofs hid_generic usbhid hid uas
> usb_storage btrfs xor raid6_pq nls_iso8859_1 dm_mirror dm_region_hash
> dm_log i915 mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea
> sysfillrect sysimgblt e1000e fb_sys_fops drm ahci ptp libahci pps_core
> fjes wmi video
> Jun 16 17:38:12 ubuntu kernel: [  199.340540] CPU: 1 PID: 7602 Comm:
> btrfs-balance Not tainted 4.4.0-21-generic #37-Ubuntu
> Jun 16 17:38:12 ubuntu kernel: [  199.340558] Hardware name: ASUS All
> Series/Z87-PLUS, BIOS 1707 12/13/2013
> Jun 16 17:38:12 ubuntu kernel: [  199.340573] task: 8804173b3700
> ti: 8803ec36c000 task.ti: 8803ec36c000
> Jun 16 17:38:12 ubuntu kernel: [  199.340589] RIP:
> 0010:[]  []
> do_relocation+0x515/0x520 [btrfs]
> Jun 16 17:38:12 ubuntu kernel: [  199.340631] RSP:
> 0018:8803ec36fb00  EFLAGS: 00010202
> Jun 16 17:38:12 ubuntu kernel: [  199.340643] RAX: 0001
> RBX: 8800bc72ca80 RCX: 
> Jun 16 17:38:12 ubuntu kernel: [  199.340658] RDX: 
> RSI:  RDI: 
> Jun 16 17:38:12 ubuntu kernel: [  199.340674] RBP: 8803ec36fbb8
> R08: 8803ec36fab4 R09: 1600
> Jun 16 17:38:12 ubuntu kernel: [  199.340689] R10: 0002
> R11: 0045 R12: 8803ec33f680
> Jun 16 17:38:12 ubuntu kernel: [  199.340704] R13: 88041b11
> R14: 88040026e180 R15: 0001
> Jun 16 17:38:12 ubuntu kernel: [  199.340720] FS:
> () GS:88042fa4()
> knlGS:
> Jun 16 17:38:12 ubuntu kernel: [  199.340738] CS:  001

Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-16 Thread Paul Verreth
Hello.

New test:

I booted from a live USB-stick with all updates installed
(4.4.0-21-generic), and after mount of the btrfs filesystem, the
balance continued, and a bug appeared in kern.log.

The filesystem turned readonly
An important directory was missing.


Jun 16 17:38:08 ubuntu kernel: [  195.482907] BTRFS info (device
sdb5): enabling auto recovery
Jun 16 17:38:08 ubuntu kernel: [  195.482914] BTRFS info (device
sdb5): disk space caching is enabled
Jun 16 17:38:08 ubuntu kernel: [  195.488335] BTRFS info (device
sdb5): bdev /dev/sdb5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
Jun 16 17:38:08 ubuntu kernel: [  195.488340] BTRFS info (device
sdb5): bdev /dev/sda5 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
Jun 16 17:38:08 ubuntu kernel: [  195.559146] BTRFS: detected SSD
devices, enabling SSD mode
Jun 16 17:38:08 ubuntu kernel: [  195.560224] BTRFS: checking UUID tree
Jun 16 17:38:08 ubuntu kernel: [  195.560226] BTRFS info (device
sdb5): continuing balance
Jun 16 17:38:08 ubuntu kernel: [  195.560229] BTRFS info (device
sdb5): force reducing metadata integrity
Jun 16 17:38:08 ubuntu kernel: [  195.583979] BTRFS info (device
sdb5): relocating block group 297447456768 flags 20
Jun 16 17:38:12 ubuntu kernel: [  199.340273] [ cut here
]
Jun 16 17:38:12 ubuntu kernel: [  199.340290] kernel BUG at
/build/linux-Ay7j_C/linux-4.4.0/fs/btrfs/relocation.c:2683!
Jun 16 17:38:12 ubuntu kernel: [  199.340308] invalid opcode:  [#1] SMP
Jun 16 17:38:12 ubuntu kernel: [  199.340319] Modules linked in:
intel_rapl snd_hda_codec_realtek x86_pkg_temp_thermal intel_powerclamp
snd_hda_codec_hdmi snd_hda_codec_generic coretemp snd_hda_intel
snd_hda_codec kvm snd_hda_core snd_hwdep snd_pcm irqbypass
snd_seq_midi snd_seq_midi_event crct10dif_pclmul snd_rawmidi
crc32_pclmul snd_seq aesni_intel eeepc_wmi snd_seq_device aes_x86_64
asus_wmi input_leds lrw snd_timer sparse_keymap mei_me lpc_ich
serio_raw mei snd gf128mul 8250_fintek soundcore glue_helper shpchp
ablk_helper cryptd tpm_infineon mac_hid parport_pc ppdev lp parport
autofs4 squashfs overlay nls_utf8 isofs hid_generic usbhid hid uas
usb_storage btrfs xor raid6_pq nls_iso8859_1 dm_mirror dm_region_hash
dm_log i915 mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea
sysfillrect sysimgblt e1000e fb_sys_fops drm ahci ptp libahci pps_core
fjes wmi video
Jun 16 17:38:12 ubuntu kernel: [  199.340540] CPU: 1 PID: 7602 Comm:
btrfs-balance Not tainted 4.4.0-21-generic #37-Ubuntu
Jun 16 17:38:12 ubuntu kernel: [  199.340558] Hardware name: ASUS All
Series/Z87-PLUS, BIOS 1707 12/13/2013
Jun 16 17:38:12 ubuntu kernel: [  199.340573] task: 8804173b3700
ti: 8803ec36c000 task.ti: 8803ec36c000
Jun 16 17:38:12 ubuntu kernel: [  199.340589] RIP:
0010:[]  []
do_relocation+0x515/0x520 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340631] RSP:
0018:8803ec36fb00  EFLAGS: 00010202
Jun 16 17:38:12 ubuntu kernel: [  199.340643] RAX: 0001
RBX: 8800bc72ca80 RCX: 
Jun 16 17:38:12 ubuntu kernel: [  199.340658] RDX: 
RSI:  RDI: 
Jun 16 17:38:12 ubuntu kernel: [  199.340674] RBP: 8803ec36fbb8
R08: 8803ec36fab4 R09: 1600
Jun 16 17:38:12 ubuntu kernel: [  199.340689] R10: 0002
R11: 0045 R12: 8803ec33f680
Jun 16 17:38:12 ubuntu kernel: [  199.340704] R13: 88041b11
R14: 88040026e180 R15: 0001
Jun 16 17:38:12 ubuntu kernel: [  199.340720] FS:
() GS:88042fa4()
knlGS:
Jun 16 17:38:12 ubuntu kernel: [  199.340738] CS:  0010 DS:  ES:
 CR0: 80050033
Jun 16 17:38:12 ubuntu kernel: [  199.340750] CR2: 01263860
CR3: 01e0a000 CR4: 001406e0
Jun 16 17:38:12 ubuntu kernel: [  199.340766] DR0: 
DR1:  DR2: 
Jun 16 17:38:12 ubuntu kernel: [  199.340781] DR3: 
DR6: fffe0ff0 DR7: 0400
Jun 16 17:38:12 ubuntu kernel: [  199.340796] Stack:
Jun 16 17:38:12 ubuntu kernel: [  199.340801]  
880405bf7920 880415279870 8803ec33f6c0
Jun 16 17:38:12 ubuntu kernel: [  199.340820]  880405bf7800
88040026ece0 0001 8803ed251be0
Jun 16 17:38:12 ubuntu kernel: [  199.340839]  8803ec36fb40
8803ec36fb40 8800c4956780 88040026e180
Jun 16 17:38:12 ubuntu kernel: [  199.340858] Call Trace:
Jun 16 17:38:12 ubuntu kernel: [  199.340873]  [] ?
btrfs_block_rsv_refill+0x37/0xb0 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340897]  []
relocate_tree_blocks+0x4ee/0x5f0 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340920]  [] ?
tree_insert+0x4d/0x60 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340940]  [] ?
add_tree_block+0x155/0x1e0 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340961]  []
relocate_block_group+0x41a/0x6c0 [btrfs]
Jun 16 17:38:12 ubuntu kernel: [  199.340985]  [] ?
btrfs_wait_ordered_roots+0x1d0/0x200 [btrfs]
Ju

Re: Fwd: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-15 Thread Duncan
Paul Verreth posted on Wed, 15 Jun 2016 08:29:49 +0200 as excerpted:

> When I download a video using  Firefox DownloadHelper addon, the
> filesystem suddenly turns read only. Not a coincedence, I tried it
> several times, and it happened every time again
> 
> Info:
> Linux wolfgang 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC
> 2016 x86_64 x86_64 x86_64 GNU/Linux

Well first of all, that 4.2 kernel version isn't really supported any 
more, except possibly by your distro.  It's not a mainstream LTS kernel, 
with 4.1 and 4.4 being the LTS kernels on either side, and as a short-
term support kernel, its mainstream support lasted thru 4.3...

Of course distros can choose to support whatever kernel they like, but 
then it's them doing the patch backporting and we don't track what 
they've backported and what they haven't.  So if you want to stick with a 
distro-supported kernel, the best option is to get your support from them 
as they know what they've backported and are thus in the best position to 
support it.

As far as this list, 4.6 is the current stable kernel, with 4.7 in 
development, so 4.5 is the earliest non-LTS kernel series that's really 
supported.  Or go LTS series and choose, as mentioned, 4.1 or 4.4.  3.18 
was the LTS previous to that, but it's getting a bit long in tooth by now.

> btrfs --version btrfs-progs v4.0

That too is a bit dated.  While userspace version isn't as critical for 
runtime operations as it's mostly calling on the kernel to do the real 
work, once something goes wrong and you're trying to repair it, userspace 
code becomes vitally important.  With btrfs still stabilizing, not fully 
stable and mature, and still under heavy development, and with userspace 
versions synced to kernelspace releases and about five kernel series 
releases per year, given that 4.6 is current, 4.0 is over a year outdated 
now.  And a lot of bugs have been fixed in that year-plus...

> extract from dmesg:

> [171145.415466] BTRFS error (device sda5): unable to find ref byte
> nr 75093794816 parent 0 root 257  owner 0 offset 0
> [171145.415467] [ cut here ]
> [171145.415473] WARNING: CPU: 3 PID: 15124 at
> /build/linux-HVWSXI/linux-4.2.0/fs/btrfs/extent-tree.c:6264
> __btrfs_free_extent.isra.69+0x92f/0xd70 [btrfs]()
> [171145.415474] BTRFS: Transaction aborted (error -2)
> [171145.415492] CPU: 3 PID: 15124 Comm: kworker/u16:0 Tainted: G
>  W   4.2.0-35-generic #40-Ubuntu
> [171145.415493] Hardware name: ASUS All Series/Z87-PLUS, BIOS 1707
> 12/13/2013
> [171145.415500] Workqueue: btrfs-extent-refs
> btrfs_extent_refs_helper [btrfs]

[...]

> [171145.415568] ---[ end trace 42e5b5054b17a8a2 ]---
> [171145.415570] BTRFS: error (device sda5) in __btrfs_free_extent:6264:
> errno=-2 No such entry
> [171145.415571] BTRFS info (device sda5): forced
> readonly [171145.415572] BTRFS: error (device sda5) in
> btrfs_run_delayed_refs:2788: errno=-2 No such entry


I'm not a dev, just a btrfs user and list regular, so the stack dump 
doesn't mean a whole lot to me.  What I can say, however, is that yes, 
this is btrfs involved...

And it's pretty standard for btrfs to force itself read-only when it sees 
an unexpected error that could otherwise lead to further damage, with the 
force to read-only thus protecting the filesystem from that further 
damage.

> I was able to mount RW again using -o recovery.
> 
> Based on these messages, I thought it would be usefull to do btrfs
> balance but it gave a segmentation fault after some minutes:
> 
> [246678.922508] BTRFS: error (device sdb5) in __btrfs_free_extent:6549:
> errno=-2 No such entry
> [246678.922509] BTRFS info (device sdb5): forced readonly
> [246678.922510] BTRFS: error (device sdb5) in
> btrfs_run_delayed_refs:2927: errno=-2 No such entry
> [246678.922520] BTRFS error (device sdb5): Error removing orphan entry,
> stopping orphan cleanup
> [246678.922521] BTRFS error (device sdb5): could not do orphan
> cleanup -22
> [246678.937230] BTRFS error (device sdb5): cleaner transaction attach
> returned -30

FWIW, orphans are files that were deleted when the file was in-use, 
typically *.so libraries that were replaced on package update, but where 
some executable that was running at the time was still using them, so 
they couldn't be fully deleted as there was still and open reference to 
them.

Normally, orphans will be deleted on umount or for the root filesystem, 
on (normal) remount-read-only, after whatever executables that were 
holding them open have terminated or been killed.  However, that doesn't 
have a chance to happen when the filesystem is forced read-only due to 
error, as above, so then they have to be cleaned up when the filesystem 
is remounted writable once again.

Btrfs does this normally, so this would have been unrelated to the 
balance.

> Balance:
> 
> btrfs balance start -v -dconvert=raid1 -mconvert=raid1 /mnt
> Dumping filters: flags 0x7, state 0x0, force is off
> DATA (flags 0x100): converting, t

Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-15 Thread Paul Verreth
Hello Fajar.

Thanks.

But since I can't boot anymore from the filesystem I tried to repair
the situation using a Xenial Live USB-stick with kernel
4.4.0-22-generic.

Without any success. The balance seems active, but there is no
noticable progress in DMESG, kern.log or using balance status.

Kind regards.

2016-06-15 8:42 GMT+02:00 Fajar A. Nugraha :
> On Wed, Jun 15, 2016 at 1:29 PM, Paul Verreth  wrote:
>> Dear all.
>>
>> When I download a video using  Firefox DownloadHelper addon, the
>> filesystem suddenly turns read only. Not a coincedence, I tried it
>> several times, and it happened every time again
>>
>> Info:
>> Linux wolfgang 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC
>> 2016 x86_64 x86_64 x86_64 GNU/Linux
>
>> Segmentation fault
>>
>> Jun  5 15:03:15 ubuntu kernel: [ 2062.544303] BTRFS info (device
>> sdb5): relocating block group 383447465984 flags 17
>
>
>> What can I do to repair this problem?
>
> The usual starting advice would be "try with latest kernel and see if
> you can still reproduce the problem". Is it ubuntu wily? It'd go end
> of in July anyway, so you might want to upgrade to xenial (or at
> least, just the kernel, for the purpose of troubleshooting your
> problem).
>
> Or even try http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/
> (should be usable, but might report some errors/warning due to missing
> ubuntu patches)
>
> --
> Fajar



-- 

Paul Verreth

Het verschil tussen theorie en praktijk
is klein in theorie,
maar in praktijk daarentegen ...
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-14 Thread Fajar A. Nugraha
On Wed, Jun 15, 2016 at 1:29 PM, Paul Verreth  wrote:
> Dear all.
>
> When I download a video using  Firefox DownloadHelper addon, the
> filesystem suddenly turns read only. Not a coincedence, I tried it
> several times, and it happened every time again
>
> Info:
> Linux wolfgang 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC
> 2016 x86_64 x86_64 x86_64 GNU/Linux

> Segmentation fault
>
> Jun  5 15:03:15 ubuntu kernel: [ 2062.544303] BTRFS info (device
> sdb5): relocating block group 383447465984 flags 17


> What can I do to repair this problem?

The usual starting advice would be "try with latest kernel and see if
you can still reproduce the problem". Is it ubuntu wily? It'd go end
of in July anyway, so you might want to upgrade to xenial (or at
least, just the kernel, for the purpose of troubleshooting your
problem).

Or even try http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/
(should be usable, but might report some errors/warning due to missing
ubuntu patches)

-- 
Fajar
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fwd: BTRFS, remarkable problem: filesystem turns to read-only caused by firefox download

2016-06-14 Thread Paul Verreth
Dear all.

When I download a video using  Firefox DownloadHelper addon, the
filesystem suddenly turns read only. Not a coincedence, I tried it
several times, and it happened every time again

Info:
Linux wolfgang 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC
2016 x86_64 x86_64 x86_64 GNU/Linux

btrfs --version
btrfs-progs v4.0

firefox --version
Mozilla Firefox 46.0

package: btrfs-tools
State: installed
Automatically installed: no
Version: 4.0-2
Priority: optional
Section: admin
Maintainer: Ubuntu Developers 
Architecture: amd64
Uncompressed Size: 3.518 k
Depends: e2fslibs (>= 1.42), libblkid1 (>= 2.17.2), libc6 (>= 2.8), libcomerr2
 (>= 1.01), liblzo2-2, libuuid1 (>= 2.16), zlib1g (>= 1:1.2.0)
Conflicts: btrfs-tools
Description: Checksumming Copy on Write Filesystem utilities

Homepage: http://btrfs.wiki.kernel.org/


extract from dmesg:

[171145.415378] tree block key (18446744073709551611 48 3255000) level 0
[171145.415379] shared block backref parent 203105845248
[171145.415379] item 4 key (75093737472 168 4096) itemoff 3740 itemsize 51
[171145.415380] extent refs 1 gen 1551545 flags 258
[171145.415381] tree block key (3547221 12 3547219) level 0
[171145.415381] shared block backref parent 75092348928
[171145.415382] item 5 key (75093741568 168 4096) itemoff 3689 itemsize 51
[171145.415382] extent refs 1 gen 1452265 flags 258
[171145.415383] tree block key (3280755 12 3280753) level 0
[171145.415383] shared block backref parent 203105845248
[171145.415384] item 6 key (75093745664 168 4096) itemoff 3638 itemsize 51
[171145.415385] extent refs 1 gen 1452265 flags 258
[171145.415385] tree block key (18446744073709551611 48 3255000) level 0
[171145.415386] shared block backref parent 203105845248
[171145.415386] item 7 key (75093749760 168 4096) itemoff 3587 itemsize 51
[171145.415387] extent refs 1 gen 1514341 flags 258
[171145.415387] tree block key (3473870 1 0) level 0
[171145.415388] shared block backref parent 75091329024
[171145.415388] item 8 key (75093753856 168 4096) itemoff 3536 itemsize 51
[171145.415389] extent refs 1 gen 1597177 flags 258
[171145.415390] tree block key (2921841 108 6848512) level 0
[171145.415390] shared block backref parent 75091030016
[171145.415391] item 9 key (75093757952 168 4096) itemoff 3485 itemsize 51
[171145.415391] extent refs 1 gen 1452265 flags 258
[171145.415392] tree block key (18446744073709551611 48 3254998) level 0
[171145.415392] shared block backref parent 203105845248
[171145.415393] item 10 key (75093766144 168 4096) itemoff 3434 itemsize 51
[171145.415394] extent refs 1 gen 1452265 flags 258
[171145.415394] tree block key (3280757 96 12) level 0
[171145.415395] shared block backref parent 203105845248
[171145.415395] item 11 key (75093770240 168 4096) itemoff 3383 itemsize 51
[171145.415396] extent refs 1 gen 1452265 flags 258
[171145.415396] tree block key (18446744073709551611 48 3254998) level 0
[171145.415397] shared block backref parent 203105845248
[171145.415398] item 12 key (75093774336 168 4096) itemoff 3332 itemsize 51
[171145.415398] extent refs 1 gen 1452265 flags 258
[171145.415399] tree block key (3280738 84 4205285998) level 0
[171145.415399] shared block backref parent 203105845248
[171145.415400] item 13 key (75093778432 168 4096) itemoff 3281 itemsize 51
[171145.415400] extent refs 1 gen 1452265 flags 258
[171145.415401] tree block key (18446744073709551611 48 3254998) level 0
[171145.415401] shared block backref parent 203105845248
[171145.415402] item 14 key (75093782528 168 4096) itemoff 3230 itemsize 51
[171145.415403] extent refs 1 gen 1551545 flags 258
[171145.415403] tree block key (3547236 84 3743801254) level 0
[171145.415404] shared block backref parent 75092348928
[171145.415404] item 15 key (75093790720 168 4096) itemoff 3179 itemsize 51
[171145.415405] extent refs 1 gen 305740 flags 258
[171145.415406] tree block key (831798 96 265) level 0
[171145.415406] shared block backref parent 25729994752
[171145.415407] item 16 key (75093794816 168 4096) itemoff 3128 itemsize 51
[171145.415407] extent refs 1 gen 1525268 flags 2
[171145.415408] tree block key (11528453 1 0) level 0
[171145.415408] tree block backref root 281474976710913
[171145.415409] item 17 key (75093798912 168 4096) itemoff 3077 itemsize 51
[171145.415410] extent refs 1 gen 1452265 flags 258
[171145.415410] tree block key (18446744073709551611 48 3254998) level 0
[171145.415411] shared block backref parent 203105845248
[171145.415411] item 18 key (75093803008 168 4096) itemoff 3026 itemsize 51
[171145.415412] extent refs 1 gen 1452265 flags 258
[171145.415413] tree block key (18446744073709551611 48 3255000) level 0
[171145.415413] shared block backref parent 203105845248
[171145.415414] item 19 key (75093807104 168 4096) itemoff 2975 itemsize 51
[171145.415414] extent refs 1 gen 1141992 flags 2
[171145.415415] tree block key (25600704512 168 4096) level 0
[171145.415415] tree block backref root 2
[171145.415416] item 20 key (75093811200 168 4