From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f174.google.com ([209.85.214.174]:58366 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807Ab2JJUV4 (ORCPT ); Wed, 10 Oct 2012 16:21:56 -0400 Received: by mail-ob0-f174.google.com with SMTP id uo13so959988obb.19 for ; Wed, 10 Oct 2012 13:21:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20121001122832.53c25596@natsu> References: <20121001122832.53c25596@natsu> Date: Wed, 10 Oct 2012 15:21:55 -0500 Message-ID: Subject: Re: block rsv returned -28 during balance From: Mitch Harder To: Roman Mamedov Cc: linux-btrfs@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Mon, Oct 1, 2012 at 1:28 AM, Roman Mamedov wrote: > Hello, > > On a 3.6.0-rc7 kernel, I launched: > > # btrfs fi balance start -f -mconvert=single /mnt/tmp/ > > Current situation: > > # df -h /mnt/tmp/ > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/alpha-lv1 3.6T 2.7T 801G 78% /mnt/tmp > > # btrfs fi df /mnt/tmp/ > Data: total=3.00TB, used=2.66TB > System: total=4.00MB, used=364.00KB > Metadata, DUP: total=11.00GB, used=5.72GB > Metadata: total=63.00GB, used=0.00 > > There seems to be plenty of free space, but the balance seems to have stalled > and the dmesg is being filled with messages like this: > > [ 2926.465406] btrfs: block rsv returned -28 > [ 2926.465411] ------------[ cut here ]------------ > [ 2926.465446] WARNING: at /home/apw/COD/linux/fs/btrfs/extent-tree.c:6323 use_block_rsv+0x19f/0x1b0 [btrfs]() > [ 2926.465450] Hardware name: VirtualBox > [ 2926.465452] Modules linked in: joydev microcode parport_pc hid_generic parport psmouse serio_raw pcspkr i2c_piix4 mac_hid xfs btrfs libcrc32c zlib_deflate raid456 async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq usbhid hid e1000 > [ 2926.465517] Pid: 4682, comm: btrfs Tainted: G W 3.6.0-030600rc7-generic #201209232235 I've just run into the same issue running a balance. My kernel is a 3.6.1 kernel merged with the latest for-linus branch. The dmesg log is full of warnings, and the balance appears stuck. Looking at the results of 'btrfs fi df ...", it almost seems like btrfs is unable to allocate any more metadata space, even though there is some space available. # btrfs fi df /mnt/sabayon8/ Data: total=7.14GB, used=6.08GB System: total=4.00MB, used=4.00KB Metadata: total=1.00GB, used=973.32MB # df -T /mnt/sabayon8/ Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sdb5 btrfs 10008460 7373064 2537536 75% /mnt/sabayon8 For reference here's an example of the dmesg warning: [ 4070.726429] btrfs: block rsv returned -28 [ 4070.726431] ------------[ cut here ]------------ [ 4070.726455] WARNING: at fs/btrfs/extent-tree.c:6359 btrfs_alloc_free_block+0x4ee/0x500 [btrfs]() [ 4070.726531] Hardware name: [ 4070.726533] Modules linked in: nvidia(PO) nvidia_agp xts gf128mul ablk_helper cryptd sha256_generic btrfs libcrc32c xhci_hcd [ 4070.726543] Pid: 8717, comm: btrfs Tainted: P W O 3.6.1-git-local+ #1 [ 4070.726545] Call Trace: [ 4070.726552] [] warn_slowpath_common+0x72/0xa0 [ 4070.726569] [] ? btrfs_alloc_free_block+0x4ee/0x500 [btrfs] [ 4070.726585] [] ? btrfs_alloc_free_block+0x4ee/0x500 [btrfs] [ 4070.726590] [] warn_slowpath_null+0x22/0x30 [ 4070.726606] [] btrfs_alloc_free_block+0x4ee/0x500 [btrfs] [ 4070.726628] [] ? read_extent_buffer+0x9c/0x100 [btrfs] [ 4070.726643] [] __btrfs_cow_block+0x144/0x590 [btrfs] [ 4070.726731] [] ? verify_parent_transid+0x55/0x1c0 [btrfs] [ 4070.726746] [] ? btrfs_cow_block+0xd9/0x230 [btrfs] [ 4070.726765] [] ? mark_extent_buffer_accessed+0x59/0x70 [btrfs] [ 4070.726780] [] btrfs_cow_block+0xd9/0x230 [btrfs] [ 4070.726801] [] do_relocation+0x42a/0x4d0 [btrfs] [ 4070.726818] [] ? btrfs_block_rsv_add+0x6b/0x80 [btrfs] [ 4070.726838] [] relocate_tree_blocks+0x3fa/0x5a0 [btrfs] [ 4070.726929] [] relocate_block_group+0x212/0x670 [btrfs] [ 4070.726950] [] btrfs_relocate_block_group+0x190/0x2e0 [btrfs] [ 4070.726969] [] btrfs_relocate_chunk.isra.54+0x57/0x690 [btrfs] [ 4070.726989] [] ? btrfs_get_token_64+0x61/0x100 [btrfs] [ 4070.727008] [] ? free_extent_buffer+0x26/0x70 [btrfs] [ 4070.727045] [] btrfs_balance+0x9b1/0xf40 [btrfs] [ 4070.727051] [] ? cred_has_capability+0x7e/0xf0 [ 4070.727071] [] btrfs_ioctl_balance+0xcb/0x330 [btrfs] [ 4070.727163] [] btrfs_ioctl+0x907/0x1840 [btrfs] [ 4070.727168] [] ? lru_cache_add_lru+0x22/0x40 [ 4070.727172] [] ? handle_pte_fault+0x42f/0x5c0 [ 4070.727192] [] ? update_ioctl_balance_args+0x240/0x240 [btrfs] [ 4070.727197] [] do_vfs_ioctl+0x82/0x570 [ 4070.727202] [] ? inode_has_perm.isra.42.constprop.68+0x3a/0x50 [ 4070.727206] [] ? selinux_file_ioctl+0x46/0xe0 [ 4070.727209] [] sys_ioctl+0x6f/0x80 [ 4070.727214] [] sysenter_do_call+0x12/0x22 [ 4070.727217] ---[ end trace b39bb21a5ae11cb1 ]---