From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:26157 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932310AbaLDPLZ (ORCPT ); Thu, 4 Dec 2014 10:11:25 -0500 Date: Thu, 4 Dec 2014 23:11:14 +0800 From: Liu Bo To: linux-btrfs@vger.kernel.org Cc: Josef Bacik Subject: Warning of qgroup accounting from btrfs/057 Message-ID: <20141204150910.GA2140@localhost.localdomain> Reply-To: bo.li.liu@oracle.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-btrfs-owner@vger.kernel.org List-ID: Hi, While running xfstests, btrfs/057 complained with a WARNING, and I've changed WARNING a bit to show the wrong accounting number. (This did not occur in every run, but it's quite easy to reproduce on my box, and I use two 2G ramdisks.) Can someone who is familar with qgroup take a look at this problem? ====================================================================== The warning is WARN_ON(sign < 0 && qgroup->excl < oper->num_bytes); ====================================================================== Here is the output of xfstests: SECTION -- btrfs RECREATING -- btrfs on /dev/vdd FSTYP -- btrfs PLATFORM -- Linux/x86_64 localhost 3.18.0-rc6+ MKFS_OPTIONS -- /dev/vdc MOUNT_OPTIONS -- -o context=system_u:object_r:nfs_t:s0 /dev/vdc /mnt/scratch btrfs/057 - output mismatch (see /root/1_source/xfstests/results/120414_1913/btrfs/btrfs/057.out.bad) --- tests/btrfs/057.out 2014-08-15 10:17:55.025724505 +0800 +++ /root/1_source/xfstests/results/120414_1913/btrfs/btrfs/057.out.bad 2014-12-04 19:13:38.825553475 +0800 @@ -1,3 +1,3 @@ QA output created by 057 -4096 4096 -4096 4096 +4096 18446744073709547520 +4096 18446744073709547520 ... (Run 'diff -u tests/btrfs/057.out /root/1_source/xfstests/results/120414_1913/btrfs/btrfs/057.out.bad' to see the entire diff) Ran: btrfs/057 Failures: btrfs/057 Failed 1 of 1 tests ====================================================================== Here is the stack: [ 43.120200] BTRFS info (device vdc): disk space caching is enabled [ 43.125667] BTRFS: creating UUID tree [ 43.128145] SELinux: initialized (dev vdc, type btrfs), uses mountpoint labeling [ 47.171882] BTRFS info (device vdc): qgroup_rescan_init failed with -115 [ 47.276730] BTRFS info (device vdc): qgroup scan completed [ 47.476488] ------------[ cut here ]------------ [ 47.477682] WARNING: CPU: 1 PID: 61 at fs/btrfs/qgroup.c:1422 btrfs_delayed_qgroup_accounting+0x5a0/0xf50() [ 47.480016] qgroup->excl=217088, oper->num=221184 ( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) [ 47.481182] Modules linked in: [ 47.482092] CPU: 1 PID: 61 Comm: kworker/u8:1 Not tainted 3.18.0-rc6+ #446 [ 47.483951] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014 [ 47.487439] Workqueue: btrfs-extent-refs btrfs_extent_refs_helper [ 47.488621] 0000000000000009 ffff88001e12baf8 ffffffff81820d8d 0000000000000001 [ 47.490674] ffff88001e12bb48 ffff88001e12bb38 ffffffff8107819c 0000000000000000 [ 47.492559] ffff88001e441000 ffff88001f4fce08 ffffffffffffffff ffff88001e441058 [ 47.494379] Call Trace: [ 47.494884] [] dump_stack+0x4e/0x68 [ 47.495722] [] warn_slowpath_common+0x8c/0xc0 [ 47.496964] [] warn_slowpath_fmt+0x46/0x50 [ 47.497944] [] ? _raw_spin_lock+0x41/0x50 [ 47.498907] [] btrfs_delayed_qgroup_accounting+0x5a0/0xf50 [ 47.500047] [] btrfs_run_delayed_refs+0x271/0x2c0 [ 47.500999] [] delayed_ref_async_start+0x37/0x90 [ 47.501967] [] normal_work_helper+0xdd/0x330 [ 47.502930] [] btrfs_extent_refs_helper+0x12/0x20 [ 47.503992] [] process_one_work+0x1c5/0x500 [ 47.504936] [] ? process_one_work+0x14c/0x500 [ 47.505924] [] worker_thread+0x11b/0x450 [ 47.506862] [] ? rescuer_thread+0x270/0x270 [ 47.507822] [] kthread+0xe4/0x100 [ 47.508672] [] ? flush_kthread_worker+0x70/0x70 [ 47.509699] [] ret_from_fork+0x7c/0xb0 [ 47.510605] [] ? flush_kthread_worker+0x70/0x70 [ 47.511618] ---[ end trace 48407548559b14ea ]--- [ 47.872350] ------------[ cut here ]------------ [ 47.873122] WARNING: CPU: 0 PID: 1361 at fs/btrfs/qgroup.c:1422 btrfs_delayed_qgroup_accounting+0x5a0/0xf50() [ 47.874957] qgroup->excl=0, oper->num=4096 ( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) [ 47.884067] Modules linked in: [ 47.885312] CPU: 0 PID: 1361 Comm: btrfs Tainted: G W 3.18.0-rc6+ #446 [ 47.887145] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014 [ 47.890041] 0000000000000009 ffff88003e8e7aa8 ffffffff81820d8d 0000000000000001 [ 47.892044] ffff88003e8e7af8 ffff88003e8e7ae8 ffffffff8107819c 0000000000000000 [ 47.894031] ffff880020a87080 ffff88001f4fc388 ffffffffffffffff ffff880020a870d8 [ 47.895992] Call Trace: [ 47.896630] [] dump_stack+0x4e/0x68 [ 47.897779] [] warn_slowpath_common+0x8c/0xc0 [ 47.899107] [] warn_slowpath_fmt+0x46/0x50 [ 47.900404] [] ? _raw_spin_lock+0x41/0x50 [ 47.901683] [] btrfs_delayed_qgroup_accounting+0x5a0/0xf50 [ 47.903259] [] btrfs_run_delayed_refs+0x271/0x2c0 [ 47.904670] [] btrfs_commit_transaction+0x4e/0xa10 [ 47.906121] [] btrfs_sync_fs+0x67/0xe0 [ 47.907380] [] btrfs_ioctl+0x1a2d/0x2b50 [ 47.908673] [] ? _raw_spin_unlock+0x2b/0x40 [ 47.910241] [] ? avc_has_perm+0x24/0x1d0 [ 47.911497] [] ? avc_has_perm+0x10d/0x1d0 [ 47.912776] [] ? avc_has_perm+0x125/0x1d0 [ 47.914231] [] ? avc_has_perm+0x24/0x1d0 [ 47.915512] [] ? current_kernel_time+0x5b/0xb0 [ 47.916995] [] do_vfs_ioctl+0x88/0x570 [ 47.918216] [] ? inode_has_perm.isra.24+0x27/0x30 [ 47.919644] [] ? file_has_perm+0x97/0xb0 [ 47.920909] [] ? __audit_syscall_entry+0xb4/0x110 [ 47.922331] [] SyS_ioctl+0x91/0xb0 [ 47.923485] [] system_call_fastpath+0x12/0x17 [ 47.925122] ---[ end trace 48407548559b14eb ]--- Thanks, -liubo