Hi Liu and David,
        During my local xfstests on kdave/for-next, btrfs/139 failed and
btrfs BUG_ON due to qgroup rescan.
        The bisect result is commit 560215eb3f32("Merge branch
'ext/liubo/search-cleanups-wip' into for-next-next-v4.18-20180521")
which seems merged this patchset.
        The dmesg file is attached.

Thanks,
Su



On 05/18/2018 11:00 AM, Liu Bo wrote:
> Here are a collection of patches I did for btrfs_search_slot().
> 
> v2: more explicit commit log for each patch.
> 
> Liu Bo (6):
>   Btrfs: remove superfluous free_extent_buffer
>   Btrfs: use more straightforward extent_buffer_uptodate
>   Btrfs: move get root of btrfs_search_slot to a helper
>   Btrfs: remove unused check of skip_locking
>   Btrfs: grab write lock directly if write_lock_level is the max level
>   Btrfs: remove always true check in unlock_up
> 
>  fs/btrfs/ctree.c | 121 
> +++++++++++++++++++++++++++++++++----------------------
>  1 file changed, 73 insertions(+), 48 deletions(-)
> 


[   46.129166] BTRFS info (device vdb): disk space caching is enabled
[   46.130545] BTRFS info (device vdb): has skinny extents
[   46.171386] mount (2798) used greatest stack depth: 12920 bytes left
[   46.508170] BTRFS: device fsid 83a117c7-a9ea-4bf5-b42f-7092078610d5 devid 1 
transid 5 /dev/vdc
[   46.562428] BTRFS info (device vdc): disk space caching is enabled
[   46.563690] BTRFS info (device vdc): has skinny extents
[   46.564563] BTRFS info (device vdc): flagging fs with big metadata feature
[   46.587441] BTRFS info (device vdc): checking UUID tree
[   46.766765] BTRFS info (device vdb): disk space caching is enabled
[   46.768197] BTRFS info (device vdb): has skinny extents
[   46.875534] run fstests btrfs/139 at 2018-05-22 18:40:36
[   47.559411] BTRFS: device fsid 065f3825-057e-451f-8722-0d94d4a3f36f devid 1 
transid 5 /dev/vdc
[   47.612001] BTRFS info (device vdc): disk space caching is enabled
[   47.613254] BTRFS info (device vdc): has skinny extents
[   47.614147] BTRFS info (device vdc): flagging fs with big metadata feature
[   47.632377] BTRFS info (device vdc): checking UUID tree
[   47.681656] btrfs (3176) used greatest stack depth: 12632 bytes left
[   47.691156] ------------[ cut here ]------------
[   47.692084] kernel BUG at fs/btrfs/locking.c:286!
[   47.692929] invalid opcode: 0000 [#1] SMP KASAN PTI
[   47.694128] Modules linked in: btrfs xor zstd_decompress zstd_compress 
xxhash raid6_pq efivarfs xfs
[   47.695593] CPU: 3 PID: 1060 Comm: kworker/u8:5 Not tainted 4.17.0-rc6+ #20
[   47.696708] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 
02/06/2015
[   47.697985] Workqueue: btrfs-qgroup-rescan btrfs_qgroup_rescan_helper [btrfs]
[   47.699167] RIP: 0010:btrfs_assert_tree_read_locked+0xe4/0x100 [btrfs]
[   47.700243] RSP: 0018:ffff88014d50ed68 EFLAGS: 00010246
[   47.701094] RAX: dffffc0000000000 RBX: 1ffff10029aa1dad RCX: ffffffffa0845ac9
[   47.702254] RDX: 1ffff10029aa1db1 RSI: 0000000000000004 RDI: ffff88014fe29d18
[   47.703413] RBP: 1ffff10029aa1db1 R08: ffffed0029fc53a4 R09: ffffed0029fc53a3
[   47.704669] R10: ffffed0029fc53a3 R11: ffff88014fe29d1b R12: 0000000000000000
[   47.705905] R13: dffffc0000000000 R14: ffff880152dd10c0 R15: dffffc0000000000
[   47.708169] FS:  0000000000000000(0000) GS:ffff88015b200000(0000) 
knlGS:0000000000000000
[   47.709522] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   47.714771] CR2: 00005630aef46298 CR3: 0000000004216006 CR4: 00000000003606e0
[   47.717890] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   47.720258] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   47.722128] Call Trace:
[   47.723306]  ? btrfs_ioctl+0x7d20/0x7d20 [btrfs]
[   47.725323]  btrfs_set_lock_blocking_rw+0x2d1/0x420 [btrfs]
[   47.726989]  ? btrfs_assert_tree_locked+0x100/0x100 [btrfs]
[   47.728657]  ? __mutex_lock+0xdd8/0x1750
[   47.729962]  ? find_held_lock+0x3a/0x1c0
[   47.731316]  ? btrfs_qgroup_rescan_worker+0x381/0x11d0 [btrfs]
[   47.732884]  ? mutex_trylock+0x240/0x240
[   47.734257]  ? wait_for_completion+0x6a0/0x6a0
[   47.735643]  btrfs_set_path_blocking+0x79/0xe0 [btrfs]
[   47.737306]  btrfs_clear_path_blocking+0x60/0x160 [btrfs]
[   47.738823]  btrfs_search_slot+0x81e/0x23c0 [btrfs]
[   47.740298]  ? btrfs_record_root_in_trans+0xf2/0x140 [btrfs]
[   47.741835]  ? split_leaf+0x13c0/0x13c0 [btrfs]
[   47.743272]  ? btrfs_commit_transaction+0x2a00/0x2a00 [btrfs]
[   47.744821]  ? init_object+0x4e/0x80
[   47.746122]  ? btrfs_qgroup_rescan_worker+0xac/0x11d0 [btrfs]
[   47.747727]  ? __lock_is_held+0xb4/0x140
[   47.749061]  ? btrfs_qgroup_rescan_worker+0xac/0x11d0 [btrfs]
[   47.750654]  btrfs_search_slot_for_read+0x105/0x2e0 [btrfs]
[   47.752218]  btrfs_qgroup_rescan_worker+0x3bb/0x11d0 [btrfs]
[   47.754506]  ? sched_clock_cpu+0x18/0x180
[   47.755819]  ? add_qgroup_rb+0x4a0/0x4a0 [btrfs]
[   47.757335]  ? lock_acquire+0x470/0x470
[   47.758594]  ? do_raw_spin_unlock+0xa6/0x2f0
[   47.759870]  ? do_raw_spin_trylock+0x1a0/0x1a0
[   47.761184]  ? do_raw_spin_trylock+0x10/0x1a0
[   47.762425]  ? do_raw_spin_lock+0x1c0/0x1c0
[   47.763663]  normal_work_helper+0x244/0x1300 [btrfs]
[   47.764988]  ? native_sched_clock+0x7d/0x1b0
[   47.766350]  ? __btrfs_alloc_workqueue+0x770/0x770 [btrfs]
[   47.767888]  ? sched_clock_cpu+0x18/0x180
[   47.769166]  ? native_sched_clock+0x7d/0x1b0
[   47.770408]  ? cyc2ns_read_end+0x10/0x10
[   47.771552]  ? lock_acquire+0x470/0x470
[   47.772679]  ? sched_clock_cpu+0x18/0x180
[   47.773899]  ? find_held_lock+0x3a/0x1c0
[   47.775075]  ? save_trace+0x2e0/0x2e0
[   47.776194]  ? lock_acquire+0x199/0x470
[   47.777321]  ? process_one_work+0xa2f/0x1bf0
[   47.778494]  ? lock_downgrade+0x6a0/0x6a0
[   47.779632]  ? do_raw_spin_trylock+0x1a0/0x1a0
[   47.780876]  ? __lock_is_held+0xb4/0x140
[   47.781989]  process_one_work+0xad9/0x1bf0
[   47.783267]  ? _raw_spin_unlock_irq+0x29/0x40
[   47.784740]  ? finish_task_switch+0x1cf/0x800
[   47.785961]  ? cancel_delayed_work_sync+0x10/0x10
[   47.787263]  ? __switch_to_asm+0x24/0x60
[   47.788350]  ? __switch_to_asm+0x30/0x60
[   47.789424]  ? __switch_to_asm+0x24/0x60
[   47.790525]  ? __switch_to_asm+0x30/0x60
[   47.791610]  ? __switch_to_asm+0x24/0x60
[   47.792663]  ? __switch_to_asm+0x30/0x60
[   47.793732]  ? __switch_to_asm+0x24/0x60
[   47.794762]  ? __switch_to_asm+0x30/0x60
[   47.795791]  ? __switch_to_asm+0x30/0x60
[   47.796851]  ? __switch_to_asm+0x24/0x60
[   47.797845]  ? __schedule+0x6d1/0x2110
[   47.798803]  ? dmar_validate_one_drhd+0x200/0x200
[   47.799896]  ? native_sched_clock+0x7d/0x1b0
[   47.800916]  ? cyc2ns_read_end+0x10/0x10
[   47.801906]  ? do_raw_spin_unlock+0xa6/0x2f0
[   47.802933]  ? find_held_lock+0x3a/0x1c0
[   47.803978]  ? worker_thread+0x39d/0x1140
[   47.804978]  ? lock_contended+0xed0/0xed0
[   47.805972]  ? lock_downgrade+0x6a0/0x6a0
[   47.806976]  ? do_raw_spin_unlock+0xa6/0x2f0
[   47.807995]  ? do_raw_spin_trylock+0x100/0x1a0
[   47.809037]  ? do_raw_spin_lock+0x1c0/0x1c0
[   47.810055]  worker_thread+0x1a4/0x1140
[   47.810969]  ? process_one_work+0x1bf0/0x1bf0
[   47.812029]  ? dmar_validate_one_drhd+0x200/0x200
[   47.813256]  ? cyc2ns_read_end+0x10/0x10
[   47.814527]  ? ret_from_fork+0x3a/0x50
[   47.815541]  ? save_trace+0x2e0/0x2e0
[   47.816550]  ? sched_clock_local+0xe4/0x150
[   47.817570]  ? find_held_lock+0x3a/0x1c0
[   47.818550]  ? schedule+0xe5/0x380
[   47.819444]  ? lock_acquire+0x470/0x470
[   47.820404]  ? __schedule+0x2110/0x2110
[   47.821362]  ? do_raw_spin_unlock+0xa6/0x2f0
[   47.822370]  ? do_raw_spin_trylock+0x1a0/0x1a0
[   47.823421]  ? do_raw_spin_lock+0x1c0/0x1c0
[   47.824432]  ? parse_args.cold.17+0x1fa/0x1fa
[   47.825479]  ? _raw_spin_unlock_irqrestore+0x43/0x50
[   47.826763]  ? process_one_work+0x1bf0/0x1bf0
[   47.827793]  ? process_one_work+0x1bf0/0x1bf0
[   47.828822]  kthread+0x30c/0x3d0
[   47.829698]  ? kthread_create_worker_on_cpu+0xb0/0xb0
[   47.830897]  ret_from_fork+0x3a/0x50
[   47.831863] Code: df 48 c1 ed 03 c6 44 05 00 f8 45 85 e4 74 1c 48 01 c3 48 
c7 03 00 00 00 00 c7 43 08 00 00 00 00 48 83 c4 60 5b 5d 41 5c 41 5d c3 <0f> 0b 
48 89 ef e8 f2 33 f9 e0 eb c0 48 89 ef e8 48 33 f9 e0 eb 
[   47.836318] RIP: btrfs_assert_tree_read_locked+0xe4/0x100 [btrfs] RSP: 
ffff88014d50ed68
[   47.838249] ---[ end trace c6091b67dcfbaa2f ]---
[   47.839687] kworker/u8:5 (1060) used greatest stack depth: 5864 bytes left
[   61.319838] audit: type=1006 audit(1526985651.318:4): pid=3182 uid=0 
old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=3 res=1

Attachment: pEpkey.asc
Description: application/pgp-keys

Reply via email to