Qu Wenruo
7c15d41016
btrfs: ctree: Dump the leaf before BUG_ON in btrfs_set_item_key_safe
...
We have a long standing problem with reversed keys that's detected by
btrfs_set_item_key_safe. This is hard to reproduce so we'd like to
capture more information for later analysis.
Let's dump the leaf content before triggering BUG_ON() so that we can
have some clue on what's going wrong. The output of tree locks should
help us to debug such problem.
Sample stacktrace:
generic/522 [00:07:05]
[26946.113381] run fstests generic/522 at 2019-04-16 00:07:05
[27161.474720] kernel BUG at fs/btrfs/ctree.c:3192!
[27161.475923] invalid opcode: 0000 [#1 ] PREEMPT SMP
[27161.477167] CPU: 0 PID: 15676 Comm: fsx Tainted: G W 5.1.0-rc5-default+ #562
[27161.478932] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-0-ga698c89-prebuilt.qemu.org 04/01/2014
[27161.481099] RIP: 0010:btrfs_set_item_key_safe+0x146/0x1c0 [btrfs]
[27161.485369] RSP: 0018:ffffb087499e39b0 EFLAGS: 00010286
[27161.486464] RAX: 00000000ffffffff RBX: ffff941534d80e70 RCX: 0000000000024000
[27161.487929] RDX: 0000000000013039 RSI: ffffb087499e3aa5 RDI: ffffb087499e39c7
[27161.489289] RBP: 000000000000000e R08: ffff9414e0f49008 R09: 0000000000001000
[27161.490807] R10: 0000000000000000 R11: 0000000000000003 R12: ffff9414e0f48e70
[27161.492305] R13: ffffb087499e3aa5 R14: 0000000000000000 R15: 0000000000071000
[27161.493845] FS: 00007f8ea58d0b80(0000) GS:ffff94153d400000(0000) knlGS:0000000000000000
[27161.495608] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[27161.496717] CR2: 00007f8ea57a9000 CR3: 0000000016a33000 CR4: 00000000000006f0
[27161.498100] Call Trace:
[27161.498771] __btrfs_drop_extents+0x6ec/0xdf0 [btrfs]
[27161.499872] btrfs_log_changed_extents.isra.26+0x3a2/0x9e0 [btrfs]
[27161.501114] btrfs_log_inode+0x7ff/0xdc0 [btrfs]
[27161.502114] ? __mutex_unlock_slowpath+0x4b/0x2b0
[27161.503172] btrfs_log_inode_parent+0x237/0x9c0 [btrfs]
[27161.504348] btrfs_log_dentry_safe+0x4a/0x70 [btrfs]
[27161.505374] btrfs_sync_file+0x1b7/0x480 [btrfs]
[27161.506371] __x64_sys_msync+0x180/0x210
[27161.507208] do_syscall_64+0x54/0x180
[27161.507932] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[27161.508839] RIP: 0033:0x7f8ea5aa9c61
[27161.512616] RSP: 002b:00007ffea2a06498 EFLAGS: 00000246 ORIG_RAX: 000000000000001a
[27161.514161] RAX: ffffffffffffffda RBX: 000000000002a938 RCX: 00007f8ea5aa9c61
[27161.515376] RDX: 0000000000000004 RSI: 000000000001c9b2 RDI: 00007f8ea578d000
[27161.516572] RBP: 000000000001c07a R08: fffffffffffffff8 R09: 000000000002a000
[27161.517883] R10: 00007f8ea57a99b2 R11: 0000000000000246 R12: 0000000000000938
[27161.519080] R13: 00007f8ea578d000 R14: 000000000001c9b2 R15: 0000000000000000
[27161.520281] Modules linked in: btrfs libcrc32c xor zstd_decompress zstd_compress xxhash raid6_pq loop [last unloaded: scsi_debug]
[27161.522272] ---[ end trace d5afec7ccac6a252 ]---
[27161.523111] RIP: 0010:btrfs_set_item_key_safe+0x146/0x1c0 [btrfs]
[27161.527253] RSP: 0018:ffffb087499e39b0 EFLAGS: 00010286
[27161.528192] RAX: 00000000ffffffff RBX: ffff941534d80e70 RCX: 0000000000024000
[27161.529392] RDX: 0000000000013039 RSI: ffffb087499e3aa5 RDI: ffffb087499e39c7
[27161.530607] RBP: 000000000000000e R08: ffff9414e0f49008 R09: 0000000000001000
[27161.531802] R10: 0000000000000000 R11: 0000000000000003 R12: ffff9414e0f48e70
[27161.533018] R13: ffffb087499e3aa5 R14: 0000000000000000 R15: 0000000000071000
[27161.534405] FS: 00007f8ea58d0b80(0000) GS:ffff94153d400000(0000) knlGS:0000000000000000
[27161.536048] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[27161.537210] CR2: 00007f8ea57a9000 CR3: 0000000016a33000 CR4: 00000000000006f0
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-04-29 19:02:52 +02:00
..
2019-03-17 09:10:56 -07:00
2018-08-22 10:52:51 -07:00
2019-04-13 08:37:37 +01:00
2019-03-07 18:32:01 -08:00
2019-01-04 13:13:47 -08:00
2019-04-29 19:02:52 +02:00
2018-11-30 16:00:58 +00:00
2019-04-23 21:37:54 +02:00
2019-04-24 12:33:59 -05:00
2018-07-17 06:14:07 -07:00
2018-10-30 12:46:25 -07:00
2019-03-09 10:54:24 -08:00
2019-04-01 00:31:02 -04:00
2019-01-24 13:38:30 -05:00
2019-02-03 11:17:31 -08:00
2019-01-25 18:41:52 +08:00
2018-07-22 14:13:44 +02:00
2018-11-23 09:08:17 -05:00
2019-03-07 09:01:33 -08:00
2019-03-24 13:41:37 -07:00
2019-03-15 13:42:53 -07:00
2019-03-07 18:32:01 -08:00
2018-11-30 15:57:31 +00:00
2019-04-14 15:09:40 -07:00
2019-03-09 11:52:11 -08:00
2018-11-30 14:56:14 -08:00
2019-01-04 13:13:47 -08:00
2018-08-17 16:20:28 -07:00
2019-03-12 09:58:03 -07:00
2019-04-05 16:02:31 -10:00
2018-09-29 22:47:48 -04:00
2019-03-01 00:36:57 -05:00
2019-04-01 00:31:02 -04:00
2018-09-20 09:28:49 -05:00
2019-03-12 14:08:19 -07:00
2019-03-18 22:39:34 -04:00
2019-04-11 15:23:48 -04:00
2019-04-22 15:38:41 -04:00
2019-02-06 13:12:15 -05:00
2019-03-19 09:29:07 +01:00
2018-12-28 12:11:47 -08:00
2019-03-29 10:01:37 -07:00
2018-11-18 13:35:19 -08:00
2019-03-12 13:27:20 -07:00
2019-02-13 11:14:46 +01:00
2019-04-26 09:18:05 -07:00
2019-02-12 13:45:53 -08:00
2018-12-18 18:29:15 +01:00
2018-10-31 08:54:14 -07:00
2018-08-02 09:34:02 -07:00
2019-03-16 10:31:02 -07:00
2018-11-10 08:02:40 -05:00
2018-07-31 11:32:44 -04:00
2019-04-01 00:31:02 -04:00
2019-03-18 16:30:02 +01:00
2018-08-17 16:20:27 -07:00
2019-03-26 08:37:55 -07:00
2019-04-04 20:13:59 -04:00
2018-07-12 10:04:27 -04:00
2018-07-12 10:04:20 -04:00
2019-03-05 10:00:35 -08:00
2019-03-07 18:32:01 -08:00
2019-02-18 16:49:36 -08:00
2019-04-11 21:22:21 -06:00
2019-02-28 13:59:41 -07:00
2018-08-27 14:48:48 +02:00
2018-10-29 14:29:58 -07:00
2018-10-03 16:47:43 +02:00
2019-03-13 13:58:46 -07:00
2019-01-30 11:02:11 -08:00
2019-02-15 08:40:11 -07:00
2019-02-01 15:46:24 -08:00
2019-03-07 18:32:01 -08:00
2019-03-07 18:32:01 -08:00
2018-10-03 16:47:43 +02:00
2019-02-28 08:24:23 -07:00
2019-03-08 14:48:40 -08:00
2019-02-28 03:29:26 -05:00
2019-02-28 03:29:37 -05:00
2019-03-29 10:01:38 -07:00
2019-01-21 17:48:13 +01:00
2019-01-22 14:39:38 -07:00
2019-03-05 21:07:13 -08:00
2019-02-28 03:28:53 -05:00
2019-04-23 08:17:58 -06:00
2019-01-03 18:57:57 -08:00
2019-03-18 10:44:48 -06:00
2019-03-12 14:08:19 -07:00
2018-08-02 08:06:55 +09:00
2019-03-25 08:36:24 -04:00
2019-03-12 14:08:19 -07:00
2019-01-30 17:44:07 -05:00
2019-02-15 08:40:11 -07:00
2019-03-12 14:08:19 -07:00
2019-03-12 14:08:19 -07:00
2019-04-06 07:01:55 -10:00
2019-04-14 15:09:40 -07:00
2019-01-30 17:14:50 -05:00
2019-01-30 17:14:50 -05:00
2019-04-06 07:01:55 -10:00
2019-01-03 18:57:57 -08:00
2019-02-07 00:13:27 +01:00
2018-08-17 16:20:28 -07:00
2018-10-03 16:47:43 +02:00
2019-04-26 11:09:55 -07:00
2019-02-01 01:55:45 -05:00
2019-02-07 16:38:35 +01:00
2019-02-28 03:29:38 -05:00
2019-02-07 00:13:27 +01:00
2019-04-19 09:46:05 -07:00
2019-02-07 00:13:27 +01:00
2018-09-18 07:30:48 -04:00