Re: can't use btrfs on USB-stick (write errors)

2016-07-11 Thread David Sterba
On Tue, Jun 21, 2016 at 11:54:57PM +0900, Tomasz Chmielewski wrote:
> I've tried to use btrfs on USB-stick, but unfortunately it fails with 
> write errors.
> 
> The below is for kernel 4.4; I've tried with 4.6.2, and it fails in a 
> similar way.
> 
> 
> I'm not sure how to reliably reproduce it, but it seems to me it has 
> something to do with:
> 
> - plenty of random writes
> 
> - USB stick sometimes "very slow to reply" (may be USB-stick dependent)
> 
> 
> The closest thing to reproduce pretty much within an hour was launching 
> ktorrent and downloading a couple of Linux isos.
> 
> ext4 does not fail under similar load. USB stick is brand new, writing 
> data with dd is successful, reading data with dd is successful (whether 
> it's ext4, btrfs or raw partition); it only seems to fail with btrfs and 
> plenty of random writes.

I think it's the write pattern that does not go well with the usb stick.
>From the logs provided, it's an EIO during transaction commit, that's
usually fatal so the filesystem switches to read-only.

The dd write pattern (and consecutive writes) do not stress the flash
translation layer or it's internal block allocation and reclaim. As you
say it's not easy to reproduce, I'm more inclined to blame the usb
stick.
--
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


can't use btrfs on USB-stick (write errors)

2016-06-21 Thread Tomasz Chmielewski
I've tried to use btrfs on USB-stick, but unfortunately it fails with 
write errors.


The below is for kernel 4.4; I've tried with 4.6.2, and it fails in a 
similar way.



I'm not sure how to reliably reproduce it, but it seems to me it has 
something to do with:


- plenty of random writes

- USB stick sometimes "very slow to reply" (may be USB-stick dependent)


The closest thing to reproduce pretty much within an hour was launching 
ktorrent and downloading a couple of Linux isos.


ext4 does not fail under similar load. USB stick is brand new, writing 
data with dd is successful, reading data with dd is successful (whether 
it's ext4, btrfs or raw partition); it only seems to fail with btrfs and 
plenty of random writes.



Jun 14 07:50:26 ativ kernel: [57362.029895] 
btrfs_dev_stat_print_on_error: 3 callbacks suppressed
Jun 14 07:50:26 ativ kernel: [57362.029912] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 1, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.030912] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 2, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.031585] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 3, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.032260] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 4, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033040] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 5, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033400] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 6, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033408] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 7, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033491] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 8, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033498] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 9, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033566] BTRFS error (device sdb1): 
bdev /dev/sdb1 errs: wr 10, rd 0, flush 0, corrupt 0, gen 0
Jun 14 07:50:26 ativ kernel: [57362.033587] BTRFS: error (device sdb1) 
in btrfs_commit_transaction:2124: errno=-5 IO failure (Error while 
writing out transaction)
Jun 14 07:50:26 ativ kernel: [57362.033591] BTRFS info (device sdb1): 
forced readonly
Jun 14 07:50:26 ativ kernel: [57362.033597] BTRFS warning (device sdb1): 
Skipping commit of aborted transaction.
Jun 14 07:50:26 ativ kernel: [57362.033601] [ cut here 
]
Jun 14 07:50:26 ativ kernel: [57362.033659] WARNING: CPU: 3 PID: 24844 
at /build/linux-oXTOqc/linux-4.4.0/fs/btrfs/transaction.c:1746 
cleanup_transaction+0x92/0x300 [btrfs]()
Jun 14 07:50:26 ativ kernel: [57362.033662] BTRFS: Transaction aborted 
(error -5)
Jun 14 07:50:26 ativ kernel: [57362.033665] Modules linked in: 
nls_iso8859_1 ctr ccm hid_generic usbhid hid rfcomm pci_stub vboxpci(OE) 
vboxnetadp(OE) vboxnetflt(OE) msr vboxdrv(OE) drbg ansi_cprng 
xt_CHECKSUM iptable_mangle bnep ipt_MASQUERADE nf_nat_masquerade_ipv4 
iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 
xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp 
llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter 
ip_tables x_tables rtsx_usb_ms memstick ath3k btusb btrtl btbcm btintel 
amd_freq_sensitivity uvcvideo crct10dif_pclmul videobuf2_vmalloc 
videobuf2_memops crc32_pclmul bluetooth samsung_laptop videobuf2_v4l2 
videobuf2_core v4l2_common arc4 videodev media ath9k aesni_intel 
ath9k_common aes_x86_64 snd_hda_codec_realtek lrw snd_hda_codec_generic 
gf128mul ath9k_hw glue_helper snd_hda_codec_hdmi ablk_helper 
snd_hda_intel cryptd snd_hda_codec ath snd_hda_core snd_hwdep mac80211 
joydev snd_pcm edac_mce_amd input_leds snd_seq_midi edac_core serio_raw 
snd_seq_midi_event fam15h_power k10temp i2c_piix4 snd_rawmidi cfg80211 
snd_seq snd_seq_device snd_timer shpchp snd soundcore mac_hid 
binfmt_misc kvm_amd kvm irqbypass parport_pc ppdev sunrpc lp parport 
autofs4 btrfs xor raid6_pq rtsx_usb_sdmmc uas usb_storage rtsx_usb 
amdkfd amd_iommu_v2 radeon i2c_algo_bit ttm drm_kms_helper syscopyarea 
psmouse sysfillrect sysimgblt fb_sys_fops ahci drm libahci r8169 mii wmi 
fjes video
Jun 14 07:50:26 ativ kernel: [57362.033842] CPU: 3 PID: 24844 Comm: 
ktorrent Tainted: GW  OE   4.4.0-24-generic #43-Ubuntu
Jun 14 07:50:26 ativ kernel: [57362.033846] Hardware name: SAMSUNG 
ELECTRONICS CO., LTD. 905S3G/906S3G/915S3G/NP905S3G-K01PL, BIOS 
P06RBV.074.130822.FL 08/22/2013
Jun 14 07:50:26 ativ kernel: [57362.033851]  0286 
4d3ecc09 8800043a3bf0 813eab23
Jun 14 07:50:26 ativ kernel: [57362.033858]  8800043a3c38 
c03fa060 8800043a3c28 810810d2
Jun 14 07:50:26 ativ kernel: [57362.033864]  8801211a5cb0 
880137001800 8800442a93c0 fffb

Jun 14 07:50:26 ativ kernel: