btrfs scrub can neither start nor cancel

2015-12-08 Thread Wolfgang Rohdewald
I just tried this script:
http://marc.merlins.org/perso/btrfs/2014-03.html#Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair

but I did not pass the directory where the filesystem is mounted.

Next I called it correctly: btrfs-scrub /t4
I also tried btrfs scrub start / cancel directly, but 
I am not really sure what I did in which order.

Anyway now I can neither cancel nor start btrfs scrub. Rebooting did not help.
Running unmodified Linux 4.3

It seems like scrub stopped and did not clean up. Maybe because:
Dec  8 21:07:41 s5 kernel: [17833.840868] btrfs[23746]: segfault at 
ff98 ip 004079e1 sp 7fffafa27510 error 5 in 
btrfs[40+53000]

How can I now clean this up?

root@s5:~# btrfs --version
Btrfs v3.12

root@s5:~# btrfs scrub status /t4
scrub status for 700900de-e35f-4264-8f5d-1b2b249a5c3a
scrub started at Tue Dec  8 21:05:31 2015, running for 20 seconds
total bytes scrubbed: 3.09GiB with 0 errors

root@s5:~# btrfs scrub cancel /t4
ERROR: scrub cancel failed on /t4: not running

root@s5:~# btrfs scrub start /t4
ERROR: scrub is already running.
To cancel use 'btrfs scrub cancel /t4'.
To see the status use 'btrfs scrub status [-d] /t4'.


-- 
Wolfgang
--
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 scrub can neither start nor cancel

2015-12-08 Thread Wolfgang Rohdewald
Am Dienstag, 8. Dezember 2015, 20:51:08 schrieb Hugo Mills:
> On Tue, Dec 08, 2015 at 09:46:48PM +0100, Wolfgang Rohdewald wrote:
> > Anyway now I can neither cancel nor start btrfs scrub. Rebooting did not 
> > help.
> 
>It might be that the userspace tools has got confused and left
> behind a lock/pid/progress file in /var/lib/btrfs/
> 
>Take a look in there and see if there's anything that you can
> delete to good effect?

root@s5:/var/lib/btrfs# ls -l
insgesamt 4
srwxr-xr-x 1 root root   0 Dez  8 21:05 
scrub.progress.700900de-e35f-4264-8f5d-1b2b249a5c3a
-rw--- 1 root root 394 Dez  8 21:05 
scrub.status.700900de-e35f-4264-8f5d-1b2b249a5c3a

that fixed it, thanks!

I would have expected that such temporary files are deleted at reboot, so
ẗo me this looks like a bug in user-space.


-- 
Wolfgang
--
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 balance: Kernel BUG

2015-12-05 Thread Wolfgang Rohdewald
Am Samstag, 5. Dezember 2015, 11:17:26 schrieb Holger Hoffstätte:
> On 12/05/15 11:04, Wolfgang Rohdewald wrote:
> > Am Samstag, 5. Dezember 2015, 10:58:44 schrieb Holger Hoffstätte:
> >> Please see: http://www.spinics.net/lists/linux-btrfs/msg49766.html
> >>
> >> You should be able to apply those patches manually (assuming you can/want 
> >> to rebuild).
> > 
> > are my data safe if I just wait for a fixed official kernel and do not
> > balance until then?
> 
> This is not directly caused by balance, so it's possible to triger it also
> during normal operation. Another option would be to revert to 4.1.13 for the
> time being.

thanks, I am now building 4.3 with patch applied

-- 
Wolfgang
--
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


btrfs balance: Kernel BUG

2015-12-05 Thread Wolfgang Rohdewald
Unmodified Linux 4.3 tainted with nvidia

after adding disk #4 to RAID1, I did

btrfs filesystem balance /t4

Dec  5 08:07:26 s5 kernel: [55868.756847] BTRFS info (device sdc): relocating 
block group 10768619667456 flags 17
Dec  5 08:07:35 s5 kernel: [55878.297200] BTRFS info (device sdc): found 10 
extents
Dec  5 08:07:40 s5 kernel: [55882.713437] BTRFS info (device sdc): found 10 
extents
Dec  5 08:07:40 s5 kernel: [55883.219850] BTRFS info (device sdc): relocating 
block group 10767545925632 flags 17
Dec  5 08:07:57 s5 kernel: [55899.736052] BTRFS info (device sdc): found 11 
extents
Dec  5 08:07:58 s5 kernel: [55901.082464] [ cut here ]
Dec  5 08:07:58 s5 kernel: [55901.082468] Kernel BUG at a012ef06 
[verbose debug info unavailable]
Dec  5 08:07:58 s5 kernel: [55901.082470] invalid opcode:  [#1] PREEMPT SMP 
Dec  5 08:07:58 s5 kernel: [55901.082472] Modules linked in: 
snd_hda_codec_hdmi(E) joydev(E) rc_tt_1500(E) stb6100(E) lnbp22(E) 
x86_pkg_temp_thermal(E) intel_powercl
amp(E) coretemp(E) nvidia(POE) stb0899(E) kvm_intel(E) kvm(E) 
dvb_usb_pctv452e(E) snd_hda_codec_realtek(E) ttpci_eeprom(E) 
snd_hda_codec_generic(E) crct10dif_pclmul(
E) dvb_usb(E) crc32_pclmul(E) dvb_core(E) rc_core(E) ftdi_sio(E) 
snd_hda_intel(E) hid_logitech_hidpp(E) usbserial(E) snd_hda_codec(E) 
snd_hda_core(E) aesni_intel(E) 
snd_hwdep(E) aes_x86_64(E) lrw(E) gf128mul(E) glue_helper(E) snd_pcm(E) 
ablk_helper(E) cryptd(E) bnep(E) rfcomm(E) snd_seq_midi(E) 
snd_seq_midi_event(E) bluetooth(E)
 snd_rawmidi(E) microcode(E) snd_seq(E) snd_seq_device(E) snd_timer(E) 
serio_raw(E) snd(E) soundcore(E) lpc_ich(E) tpm_tis(E) mei_me(E) mei(E) 
shpchp(E) nfsd(E) auth
_rpcgss(E) nfs_acl(E) nfs(E) lockd(E) grace(E) sunrpc(E) fscache(E) btrfs(E) 
xor(E) raid6_pq(E) hid_logitech_dj(E) hid_generic(E) usbhid(E) hid(E) sd_mod(E) 
psmouse(
E) ahci(E) libahci(E) e1000e(E) ptp(E) pps_core(E) video(E)
Dec  5 08:07:58 s5 kernel: [55901.082502] CPU: 2 PID: 8553 Comm: btrfs Tainted: 
P   OE   4.3.0+55 #1
Dec  5 08:07:58 s5 kernel: [55901.082503] Hardware name:  
/DH87RL, BIOS RLH8710H.86A.0323.2013.1204.1726 12/04/2013
Dec  5 08:07:58 s5 kernel: [55901.082504] task: 8800d5e08000 ti: 
8800305e8000 task.ti: 8800305e8000
Dec  5 08:07:58 s5 kernel: [55901.082505] RIP: 0010:[]  
[] insert_inline_extent_backref+0xc6/0xd0 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082518] RSP: 0018:8800305eb868  EFLAGS: 
00010293
Dec  5 08:07:58 s5 kernel: [55901.082519] RAX:  RBX: 
 RCX: 8800305eb898
Dec  5 08:07:58 s5 kernel: [55901.082520] RDX: 0001 RSI: 
0001 RDI: 
Dec  5 08:07:58 s5 kernel: [55901.082521] RBP: 8800305eb8c8 R08: 
4000 R09: 8800305eb780
Dec  5 08:07:58 s5 kernel: [55901.082522] R10:  R11: 
0002 R12: 8800d95c6800
Dec  5 08:07:58 s5 kernel: [55901.082523] R13:  R14: 
 R15: 8800960cc1b0
Dec  5 08:07:58 s5 kernel: [55901.082524] FS:  7f78bd8da880() 
GS:88021ec8() knlGS:
Dec  5 08:07:58 s5 kernel: [55901.082525] CS:  0010 DS:  ES:  CR0: 
80050033
Dec  5 08:07:58 s5 kernel: [55901.082526] CR2: 0932e000 CR3: 
0001428b1000 CR4: 001406e0
Dec  5 08:07:58 s5 kernel: [55901.082527] Stack:
Dec  5 08:07:58 s5 kernel: [55901.082528]   0005 
 
Dec  5 08:07:58 s5 kernel: [55901.082530]  0001 880214e11000 
209e 880214e11000
Dec  5 08:07:58 s5 kernel: [55901.082532]  8800575ceac8 8800960cc1b0 
0005 880214c96000
Dec  5 08:07:58 s5 kernel: [55901.082533] Call Trace:
Dec  5 08:07:58 s5 kernel: [55901.082541]  [] 
__btrfs_inc_extent_ref.isra.49+0x98/0x250 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082545]  [] ? 
get_parent_ip+0xd/0x50
Dec  5 08:07:58 s5 kernel: [55901.082551]  [] 
__btrfs_run_delayed_refs.constprop.68+0xd1d/0x10a0 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082556]  [] ? 
_raw_write_lock+0x17/0x40
Dec  5 08:07:58 s5 kernel: [55901.082558]  [] ? 
_raw_spin_unlock+0x1a/0x40
Dec  5 08:07:58 s5 kernel: [55901.082565]  [] 
btrfs_run_delayed_refs+0x82/0x290 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082573]  [] 
btrfs_commit_transaction+0x43/0xb20 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082583]  [] 
prepare_to_merge+0x213/0x240 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082592]  [] 
relocate_block_group+0x3ea/0x600 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082599]  [] 
btrfs_relocate_block_group+0x1a5/0x290 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082607]  [] 
btrfs_relocate_chunk.isra.34+0x47/0xd0 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082615]  [] 
btrfs_balance+0x7d1/0xe90 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082623]  [] 
btrfs_ioctl_balance+0x400/0x540 [btrfs]
Dec  5 08:07:58 s5 kernel: [55901.082626]  [] ? 

Re: btrfs balance: Kernel BUG

2015-12-05 Thread Wolfgang Rohdewald
Am Samstag, 5. Dezember 2015, 10:58:44 schrieb Holger Hoffstätte:
> Please see: http://www.spinics.net/lists/linux-btrfs/msg49766.html
> 
> You should be able to apply those patches manually (assuming you can/want to 
> rebuild).
> 

are my data safe if I just wait for a fixed official kernel and do not
balance until then?

-- 
Wolfgang
--
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


Linux 4.3 call traces for defective disk

2015-12-04 Thread Wolfgang Rohdewald
I have a defect disk which produced kernel backtraces like
(see below).

Are you interested in them, what else do you need to know, do you
prefer things inline or as attachments?

unmodified Linux 4.3 tainted with nvidia driver

disk:WDC WD2002FYPS-02W3B0
196 Reallocated_Event_Count 0x0032   200   200   000Old_age   Always   
-   0
197 Current_Pending_Sector  0x0032   200   200   000Old_age   Always   
-   3
198 Offline_Uncorrectable   0x0030   200   200   000Old_age   Offline  
-   2
199 UDMA_CRC_Error_Count0x0032   200   200   000Old_age   Always   
-   0
200 Multi_Zone_Error_Rate   0x0008   200   200   000Old_age   Offline  
-   1

I mounted the disk normally (no RAID) and copied files from it.
I know I should have mounted readonly ...
Meanwhile the disk data is really corrupt, even after having it cool down 
overnight.
btrfs check -sX fails for X in 0..5. So since mounting is no longer possible, 
I cannot produce new call traces.

smartctl still says PASSED.

The data loss is no problem.

Dec  4 08:48:08 s5 kernel: [  114.814022] ata5.00: irq_stat 0x4008
Dec  4 08:48:08 s5 kernel: [  114.814024] ata5.00: failed command: READ FPDMA 
QUEUED
Dec  4 08:48:08 s5 kernel: [  114.814028] ata5.00: cmd 
60/08:60:07:8e:03/00:00:00:00:00/40 tag 12 ncq 4096 in
Dec  4 08:48:08 s5 kernel: [  114.814028]  res 
41/40:00:0e:8e:03/00:00:00:00:00/40 Emask 0x409 (media error) 
Dec  4 08:48:08 s5 kernel: [  114.814029] ata5.00: status: { DRDY ERR }
Dec  4 08:48:08 s5 kernel: [  114.814030] ata5.00: error: { UNC }
Dec  4 08:48:08 s5 kernel: [  114.822313] ata5.00: configured for UDMA/133
Dec  4 08:48:08 s5 kernel: [  114.822322] sd 4:0:0:0: [sde] tag#12 
UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
Dec  4 08:48:08 s5 kernel: [  114.822324] sd 4:0:0:0: [sde] tag#12 Sense Key : 
0x3 [current] [descriptor] 
Dec  4 08:48:08 s5 kernel: [  114.822326] sd 4:0:0:0: [sde] tag#12 ASC=0x11 
ASCQ=0x4 
Dec  4 08:48:08 s5 kernel: [  114.822328] sd 4:0:0:0: [sde] tag#12 CDB: 
opcode=0x28 28 00 00 03 8e 07 00 00 08 00
Dec  4 08:48:08 s5 kernel: [  114.822329] blk_update_request: I/O error, dev 
sde, sector 232974
Dec  4 08:48:08 s5 kernel: [  114.822340] ata5: EH complete
Dec  4 08:48:08 s5 kernel: [  114.822360] BTRFS: failed to read tree root on 
sde1


And this is one of the six backtrace I got: (BTW all six are diffent)

Dec  3 11:39:45 s5 kernel: [ 8393.928639] ata5: link is slow to respond, please 
be patient (ready=0)
Dec  3 11:39:46 s5 kernel: [ 8395.160246] ata5: SATA link up 3.0 Gbps (SStatus 
123 SControl 300)
Dec  3 11:39:46 s5 kernel: [ 8395.164216] ata5.00: ACPI cmd 
ef/10:06:00:00:00:00 (SET FEATURES) succeeded
Dec  3 11:39:46 s5 kernel: [ 8395.164219] ata5.00: ACPI cmd 
f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
Dec  3 11:39:46 s5 kernel: [ 8395.164220] ata5.00: ACPI cmd 
b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
Dec  3 11:39:46 s5 kernel: [ 8395.185378] ata5.00: ACPI cmd 
ef/10:06:00:00:00:00 (SET FEATURES) succeeded
Dec  3 11:39:46 s5 kernel: [ 8395.185381] ata5.00: ACPI cmd 
f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
Dec  3 11:39:46 s5 kernel: [ 8395.185383] ata5.00: ACPI cmd 
b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
Dec  3 11:39:46 s5 kernel: [ 8395.190195] ata5.00: configured for UDMA/133
Dec  3 11:39:46 s5 kernel: [ 8395.204218] ata5: EH complete
Dec  3 11:39:57 s5 kernel: [ 8406.044742] ata5.00: exception Emask 0x50 SAct 
0x0 SErr 0x4090800 action 0xe frozen
Dec  3 11:39:57 s5 kernel: [ 8406.044746] ata5.00: irq_stat 0x00400040, 
connection status changed
Dec  3 11:39:57 s5 kernel: [ 8406.044747] ata5: SError: { HostInt PHYRdyChg 
10B8B DevExch }
Dec  3 11:39:57 s5 kernel: [ 8406.044749] ata5.00: failed command: FLUSH CACHE 
EXT
Dec  3 11:39:57 s5 kernel: [ 8406.044752] ata5.00: cmd 
ea/00:00:00:00:00/00:00:00:00:00/a0 tag 2
Dec  3 11:39:57 s5 kernel: [ 8406.044752]  res 
40/00:0c:bf:8f:03/00:00:00:00:00/40 Emask 0x50 (ATA bus error)
Dec  3 11:39:57 s5 kernel: [ 8406.044753] ata5.00: status: { DRDY }
Dec  3 11:39:57 s5 kernel: [ 8406.044756] ata5: hard resetting link
Dec  3 11:40:03 s5 kernel: [ 8411.806856] ata5: link is slow to respond, please 
be patient (ready=0)
Dec  3 11:40:04 s5 kernel: [ 8413.038465] ata5: SATA link up 3.0 Gbps (SStatus 
123 SControl 300)
Dec  3 11:40:04 s5 kernel: [ 8413.043051] ata5.00: ACPI cmd 
ef/10:06:00:00:00:00 (SET FEATURES) succeeded
Dec  3 11:40:04 s5 kernel: [ 8413.043054] ata5.00: ACPI cmd 
f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
Dec  3 11:40:04 s5 kernel: [ 8413.043056] ata5.00: ACPI cmd 
b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
Dec  3 11:40:04 s5 kernel: [ 8413.064667] ata5.00: ACPI cmd 
ef/10:06:00:00:00:00 (SET FEATURES) succeeded
Dec  3 11:40:04 s5 kernel: [ 8413.064670] ata5.00: ACPI cmd 
f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
Dec  3 11:40:04 s5