Re: btrfs defrag kernel 3.11

2013-09-09 Thread Ahmet Inan
ive had the same problem and this commit helped, which i had to cherry-pick:

commit c83b3452db6e1b048312c50b23f06c9634535f80
Author: Josef Bacik 
Date:   Mon Jul 22 12:50:37 2013 -0400

Btrfs: reset ret in record_one_backref

I was getting warnings when running find ./ -type f -exec btrfs fi
defrag -f {}
\; from record_one_backref because ret was set.  Turns out it was
because it was
set to 1 because the search slot didn't come out exact and we
never reset it.
So reset it to 0 right after the search so we don't leak this and get
uneccessary warnings.  Thanks,

Ahmet


On Mon, Sep 9, 2013 at 4:41 AM, Wang Shilong  wrote:
>
> Hello,
>
> This bug should have been fixed by Liu Bo, the following patch:
>
> Btrfs: fix crash regarding to ulist_add_merge
>
> https://git.kernel.org/cgit/linux/kernel/git/josef/btrfs-next.git/commit/?h=for-chris&id=35f0399db6658f465b00893bdd13b992a0acfef0
>
> You can try btrfs-next:
> git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git
>
> Thanks,
> Wang
>
> On 09/07/2013 05:35 AM, Marco L. Crociani wrote:
>>
>> Hi,
>> I have run:
>> find / -xdev \( -type f -o -type d \) -exec btrfs filesystem defragment -v
>> -- {} +
>>
>> On Ubuntu 13.04 with kernel 3.11 from root recovery shell after remounting
>> rw /
>>
>> This is the dmesg output:
>>
>> [17788.691504] [ cut here ]
>> [17788.691510] [ cut here ]
>> [17788.691538] WARNING: CPU: 1 PID: 2093 at
>> /home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
>> [btrfs]()
>> [17788.691568] WARNING: CPU: 2 PID: 2095 at
>> /home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
>> [btrfs]()
>> [17788.691540] Modules linked in: snd_usb_audio
>> [17788.691570] Modules linked in: snd_usb_audio uvcvideo snd_usbmidi_lib
>> videobuf2_vmalloc videobuf2_memops videobuf2_core videodev
>> snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_intel snd_hda_codec
>> snd_hwdep btusb eeepc_wmi asus_wmi sparse_keymap snd_pcm snd_page_alloc
>> k10temp video snd_seq_midi mac_hid snd_seq_midi_event snd_rawmidi i2c_piix4
>> dm_multipath serio_raw snd_seq snd_seq_device snd_timer scsi_dh snd
>> ohci_pci soundcore bluetooth btrfs zlib_deflate libcrc32c raid10 raid456
>> async_memcpy async_raid6_recov async_pq async_xor async_tx xor raid6_pq
>> raid0 multipath linear hid_generic usbhid hid raid1 usb_storage radeon wmi
>> i2c_algo_bit ttm r8169 mii drm_kms_helper ahci drm libahci
>> [17788.691641]  uvcvideo<4>[17788.691642] CPU: 2 PID: 2095 Comm:
>> btrfs-endio-wri Not tainted 3.11.0-031100-generic #201309021735
>> [17788.691644] Hardware name: System manufacturer System Product
>> Name/F1A75-V EVO, BIOS 0702 07/12/2011
>> [17788.691645]  089e 88011b091a58 81720fca
>> 1b8b
>> [17788.691650]  snd_usbmidi_lib videobuf2_vmalloc videobuf2_memops
>> videobuf2_core videodev snd_hda_codec_realtek snd_hda_codec_hdmi
>> snd_hda_intel snd_hda_codec snd_hwdep btusb eeepc_wmi asus_wmi
>> sparse_keymap snd_pcm snd_page_alloc k10temp video snd_seq_midi mac_hid
>> snd_seq_midi_event snd_rawmidi i2c_piix4 dm_multipath serio_raw snd_seq
>> snd_seq_device snd_timer scsi_dh snd ohci_pci soundcore bluetooth btrfs
>> zlib_deflate libcrc32c raid10 raid456 async_memcpy async_raid6_recov
>> async_pq async_xor async_tx xor raid6_pq raid0 multipath linear hid_generic
>> usbhid hid raid1 usb_storage radeon wmi i2c_algo_bit ttm r8169 mii
>> drm_kms_helper ahci drm libahci
>> [17788.691717]
>> [17788.691717]   88011b091a98 8106534c
>> 88011b091a78
>> [17788.691720]  8801f3c1aea0 0001 8801056d2dc0
>> 1600
>> [17788.691722] Call Trace:
>> [17788.691727]  [] dump_stack+0x46/0x58
>> [17788.691730]  [] warn_slowpath_common+0x8c/0xc0
>> [17788.691732]  [] warn_slowpath_null+0x1a/0x20
>> [17788.691744]  [] record_one_backref+0x3a9/0x420 [btrfs]
>> [17788.691755]  [] ? btrfs_submit_direct+0x190/0x190
>> [btrfs]
>> [17788.691768]  [] iterate_leaf_refs+0x52/0xc0 [btrfs]
>> [17788.691779]  [] ? btrfs_submit_direct+0x190/0x190
>> [btrfs]
>> [17788.691790]  [] iterate_extent_inodes+0x198/0x270
>> [btrfs]
>> [17788.691801]  [] iterate_inodes_from_logical+0x92/0xb0
>> [btrfs]
>> [17788.691812]  [] ? btrfs_submit_direct+0x190/0x190
>> [btrfs]
>> [17788.691823]  [] record_extent_backrefs+0x7c/0xf0
>> [btrfs]
>> [17788.691834]  [] relink_file_extents+0x44/0x180 [btrfs]
>> [17788.691845]  [] btrfs_finish_ordered_io+0x135/0x4d0
>> [btrfs]
>> [17788.691856]  [] finish_ordered_fn+0x15/0x20 [btrfs]
>> [17788.691867]  [] worker_loop+0xa0/0x320 [btrfs]
>> [17788.691878]  [] ?
>> check_pending_worker_creates.isra.1+0xe0/0xe0 [btrfs]
>> [17788.691881]  [] kthread+0xc0/0xd0
>> [17788.691884]  [] ? flush_kthread_worker+0xb0/0xb0
>> [17788.691886]  [] ret_from_fork+0x7c/0xb0
>> [17788.691888]  [] ? flush_kthread_worker+0xb0/0xb0
>> [17788.691890] ---[ end trace b632fc27406d343c ]---
>> [17788.691892] CPU: 1 

Re: btrfs defrag kernel 3.11

2013-09-08 Thread Wang Shilong

Hello,

This bug should have been fixed by Liu Bo, the following patch:

Btrfs: fix crash regarding to ulist_add_merge

https://git.kernel.org/cgit/linux/kernel/git/josef/btrfs-next.git/commit/?h=for-chris&id=35f0399db6658f465b00893bdd13b992a0acfef0

You can try btrfs-next:
git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git

Thanks,
Wang
On 09/07/2013 05:35 AM, Marco L. Crociani wrote:

Hi,
I have run:
find / -xdev \( -type f -o -type d \) -exec btrfs filesystem defragment -v
-- {} +

On Ubuntu 13.04 with kernel 3.11 from root recovery shell after remounting
rw /

This is the dmesg output:

[17788.691504] [ cut here ]
[17788.691510] [ cut here ]
[17788.691538] WARNING: CPU: 1 PID: 2093 at
/home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
[btrfs]()
[17788.691568] WARNING: CPU: 2 PID: 2095 at
/home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
[btrfs]()
[17788.691540] Modules linked in: snd_usb_audio
[17788.691570] Modules linked in: snd_usb_audio uvcvideo snd_usbmidi_lib
videobuf2_vmalloc videobuf2_memops videobuf2_core videodev
snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_intel snd_hda_codec
snd_hwdep btusb eeepc_wmi asus_wmi sparse_keymap snd_pcm snd_page_alloc
k10temp video snd_seq_midi mac_hid snd_seq_midi_event snd_rawmidi i2c_piix4
dm_multipath serio_raw snd_seq snd_seq_device snd_timer scsi_dh snd
ohci_pci soundcore bluetooth btrfs zlib_deflate libcrc32c raid10 raid456
async_memcpy async_raid6_recov async_pq async_xor async_tx xor raid6_pq
raid0 multipath linear hid_generic usbhid hid raid1 usb_storage radeon wmi
i2c_algo_bit ttm r8169 mii drm_kms_helper ahci drm libahci
[17788.691641]  uvcvideo<4>[17788.691642] CPU: 2 PID: 2095 Comm:
btrfs-endio-wri Not tainted 3.11.0-031100-generic #201309021735
[17788.691644] Hardware name: System manufacturer System Product
Name/F1A75-V EVO, BIOS 0702 07/12/2011
[17788.691645]  089e 88011b091a58 81720fca
1b8b
[17788.691650]  snd_usbmidi_lib videobuf2_vmalloc videobuf2_memops
videobuf2_core videodev snd_hda_codec_realtek snd_hda_codec_hdmi
snd_hda_intel snd_hda_codec snd_hwdep btusb eeepc_wmi asus_wmi
sparse_keymap snd_pcm snd_page_alloc k10temp video snd_seq_midi mac_hid
snd_seq_midi_event snd_rawmidi i2c_piix4 dm_multipath serio_raw snd_seq
snd_seq_device snd_timer scsi_dh snd ohci_pci soundcore bluetooth btrfs
zlib_deflate libcrc32c raid10 raid456 async_memcpy async_raid6_recov
async_pq async_xor async_tx xor raid6_pq raid0 multipath linear hid_generic
usbhid hid raid1 usb_storage radeon wmi i2c_algo_bit ttm r8169 mii
drm_kms_helper ahci drm libahci
[17788.691717]
[17788.691717]   88011b091a98 8106534c
88011b091a78
[17788.691720]  8801f3c1aea0 0001 8801056d2dc0
1600
[17788.691722] Call Trace:
[17788.691727]  [] dump_stack+0x46/0x58
[17788.691730]  [] warn_slowpath_common+0x8c/0xc0
[17788.691732]  [] warn_slowpath_null+0x1a/0x20
[17788.691744]  [] record_one_backref+0x3a9/0x420 [btrfs]
[17788.691755]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691768]  [] iterate_leaf_refs+0x52/0xc0 [btrfs]
[17788.691779]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691790]  [] iterate_extent_inodes+0x198/0x270
[btrfs]
[17788.691801]  [] iterate_inodes_from_logical+0x92/0xb0
[btrfs]
[17788.691812]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691823]  [] record_extent_backrefs+0x7c/0xf0
[btrfs]
[17788.691834]  [] relink_file_extents+0x44/0x180 [btrfs]
[17788.691845]  [] btrfs_finish_ordered_io+0x135/0x4d0
[btrfs]
[17788.691856]  [] finish_ordered_fn+0x15/0x20 [btrfs]
[17788.691867]  [] worker_loop+0xa0/0x320 [btrfs]
[17788.691878]  [] ?
check_pending_worker_creates.isra.1+0xe0/0xe0 [btrfs]
[17788.691881]  [] kthread+0xc0/0xd0
[17788.691884]  [] ? flush_kthread_worker+0xb0/0xb0
[17788.691886]  [] ret_from_fork+0x7c/0xb0
[17788.691888]  [] ? flush_kthread_worker+0xb0/0xb0
[17788.691890] ---[ end trace b632fc27406d343c ]---
[17788.691892] CPU: 1 PID: 2093 Comm: btrfs-endio-wri Not tainted
3.11.0-031100-generic #201309021735
[17788.691894] Hardware name: System manufacturer System Product
Name/F1A75-V EVO, BIOS 0702 07/12/2011
[17788.691895]  089e 8801ba3bfa58 81720fca
1bd4
[17788.691899]   8801ba3bfa98 8106534c
8801ba3bfa78
[17788.691901]  8801f3c1ae10 0001 8801056d2dc0
1600
[17788.691903] Call Trace:
[17788.691909]  [] dump_stack+0x46/0x58
[17788.691912]  [] warn_slowpath_common+0x8c/0xc0
[17788.691914]  [] warn_slowpath_null+0x1a/0x20
[17788.691925]  [] record_one_backref+0x3a9/0x420 [btrfs]
[17788.691937]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691949]  [] iterate_leaf_refs+0x52/0xc0 [btrfs]
[17788.691960]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691971]  [] iterate_extent_inodes+0x198/0x270
[btrfs]
[17788.691982]  [] itera

btrfs defrag kernel 3.11

2013-09-06 Thread Marco L. Crociani
Hi,
I have run:
find / -xdev \( -type f -o -type d \) -exec btrfs filesystem defragment -v
-- {} +

On Ubuntu 13.04 with kernel 3.11 from root recovery shell after remounting
rw /

This is the dmesg output:

[17788.691504] [ cut here ]
[17788.691510] [ cut here ]
[17788.691538] WARNING: CPU: 1 PID: 2093 at
/home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
[btrfs]()
[17788.691568] WARNING: CPU: 2 PID: 2095 at
/home/apw/COD/linux/fs/btrfs/inode.c:2206 record_one_backref+0x3a9/0x420
[btrfs]()
[17788.691540] Modules linked in: snd_usb_audio
[17788.691570] Modules linked in: snd_usb_audio uvcvideo snd_usbmidi_lib
videobuf2_vmalloc videobuf2_memops videobuf2_core videodev
snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_intel snd_hda_codec
snd_hwdep btusb eeepc_wmi asus_wmi sparse_keymap snd_pcm snd_page_alloc
k10temp video snd_seq_midi mac_hid snd_seq_midi_event snd_rawmidi i2c_piix4
dm_multipath serio_raw snd_seq snd_seq_device snd_timer scsi_dh snd
ohci_pci soundcore bluetooth btrfs zlib_deflate libcrc32c raid10 raid456
async_memcpy async_raid6_recov async_pq async_xor async_tx xor raid6_pq
raid0 multipath linear hid_generic usbhid hid raid1 usb_storage radeon wmi
i2c_algo_bit ttm r8169 mii drm_kms_helper ahci drm libahci
[17788.691641]  uvcvideo<4>[17788.691642] CPU: 2 PID: 2095 Comm:
btrfs-endio-wri Not tainted 3.11.0-031100-generic #201309021735
[17788.691644] Hardware name: System manufacturer System Product
Name/F1A75-V EVO, BIOS 0702 07/12/2011
[17788.691645]  089e 88011b091a58 81720fca
1b8b
[17788.691650]  snd_usbmidi_lib videobuf2_vmalloc videobuf2_memops
videobuf2_core videodev snd_hda_codec_realtek snd_hda_codec_hdmi
snd_hda_intel snd_hda_codec snd_hwdep btusb eeepc_wmi asus_wmi
sparse_keymap snd_pcm snd_page_alloc k10temp video snd_seq_midi mac_hid
snd_seq_midi_event snd_rawmidi i2c_piix4 dm_multipath serio_raw snd_seq
snd_seq_device snd_timer scsi_dh snd ohci_pci soundcore bluetooth btrfs
zlib_deflate libcrc32c raid10 raid456 async_memcpy async_raid6_recov
async_pq async_xor async_tx xor raid6_pq raid0 multipath linear hid_generic
usbhid hid raid1 usb_storage radeon wmi i2c_algo_bit ttm r8169 mii
drm_kms_helper ahci drm libahci
[17788.691717]
[17788.691717]   88011b091a98 8106534c
88011b091a78
[17788.691720]  8801f3c1aea0 0001 8801056d2dc0
1600
[17788.691722] Call Trace:
[17788.691727]  [] dump_stack+0x46/0x58
[17788.691730]  [] warn_slowpath_common+0x8c/0xc0
[17788.691732]  [] warn_slowpath_null+0x1a/0x20
[17788.691744]  [] record_one_backref+0x3a9/0x420 [btrfs]
[17788.691755]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691768]  [] iterate_leaf_refs+0x52/0xc0 [btrfs]
[17788.691779]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691790]  [] iterate_extent_inodes+0x198/0x270
[btrfs]
[17788.691801]  [] iterate_inodes_from_logical+0x92/0xb0
[btrfs]
[17788.691812]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691823]  [] record_extent_backrefs+0x7c/0xf0
[btrfs]
[17788.691834]  [] relink_file_extents+0x44/0x180 [btrfs]
[17788.691845]  [] btrfs_finish_ordered_io+0x135/0x4d0
[btrfs]
[17788.691856]  [] finish_ordered_fn+0x15/0x20 [btrfs]
[17788.691867]  [] worker_loop+0xa0/0x320 [btrfs]
[17788.691878]  [] ?
check_pending_worker_creates.isra.1+0xe0/0xe0 [btrfs]
[17788.691881]  [] kthread+0xc0/0xd0
[17788.691884]  [] ? flush_kthread_worker+0xb0/0xb0
[17788.691886]  [] ret_from_fork+0x7c/0xb0
[17788.691888]  [] ? flush_kthread_worker+0xb0/0xb0
[17788.691890] ---[ end trace b632fc27406d343c ]---
[17788.691892] CPU: 1 PID: 2093 Comm: btrfs-endio-wri Not tainted
3.11.0-031100-generic #201309021735
[17788.691894] Hardware name: System manufacturer System Product
Name/F1A75-V EVO, BIOS 0702 07/12/2011
[17788.691895]  089e 8801ba3bfa58 81720fca
1bd4
[17788.691899]   8801ba3bfa98 8106534c
8801ba3bfa78
[17788.691901]  8801f3c1ae10 0001 8801056d2dc0
1600
[17788.691903] Call Trace:
[17788.691909]  [] dump_stack+0x46/0x58
[17788.691912]  [] warn_slowpath_common+0x8c/0xc0
[17788.691914]  [] warn_slowpath_null+0x1a/0x20
[17788.691925]  [] record_one_backref+0x3a9/0x420 [btrfs]
[17788.691937]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691949]  [] iterate_leaf_refs+0x52/0xc0 [btrfs]
[17788.691960]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.691971]  [] iterate_extent_inodes+0x198/0x270
[btrfs]
[17788.691982]  [] iterate_inodes_from_logical+0x92/0xb0
[btrfs]
[17788.691993]  [] ? btrfs_submit_direct+0x190/0x190
[btrfs]
[17788.692004]  [] record_extent_backrefs+0x7c/0xf0
[btrfs]
[17788.692015]  [] relink_file_extents+0x44/0x180 [btrfs]
[17788.692026]  [] btrfs_finish_ordered_io+0x135/0x4d0
[btrfs]
[17788.692037]  [] finish_ordered_fn+0x15/0x20 [btrfs]
[17788.692048]  [] worker_loop+0xa0/0x320 [btrfs]
[17788.692060]  []