Commit c4e7778
btrfs: use verbose assertions in backref.c
While debugging a relocation issue I hit an assertion in backref.c but it
was not super useful, since it could not tell what was the unexpected
value that triggered the assertion. The stack trace was this:
[583246.338097] assertion failed: !cache->nr_nodes, in fs/btrfs/backref.c:3158
[583246.339588] ------------[ cut here ]------------
[583246.340573] kernel BUG at fs/btrfs/backref.c:3158!
[583246.342075] Oops: invalid opcode: 0000 [#1] SMP PTI
[583246.343294] CPU: 5 UID: 0 PID: 677957 Comm: btrfs Not tainted 7.1.0-rc4-btrfs-next-234+ #1 PREEMPT(full)
[583246.345715] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
[583246.348694] RIP: 0010:btrfs_backref_release_cache.cold+0x61/0x84 [btrfs]
[583246.350759] Code: 90 d5 7c (...)
[583246.354923] RSP: 0018:ffffd4fc88c93ad8 EFLAGS: 00010246
[583246.355982] RAX: 000000000000003e RBX: ffff8dec90d97020 RCX: 0000000000000000
[583246.357459] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00000000ffffffff
[583246.359517] RBP: ffff8dec8eeb78c0 R08: 0000000000000000 R09: 3fffffffffefffff
[583246.361180] R10: ffffd4fc88c93970 R11: 0000000000000003 R12: ffff8decd21f3470
[583246.363184] R13: 00000000fffffffe R14: ffff8decd21f3000 R15: ffff8decd21f3000
[583246.364666] FS: 00007f9a51751400(0000) GS:ffff8df3f4255000(0000) knlGS:0000000000000000
[583246.366287] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[583246.367443] CR2: 00007f9a518ed8f5 CR3: 00000004467c8002 CR4: 0000000000370ef0
[583246.368969] Call Trace:
[583246.369541] <TASK>
[583246.370040] relocate_block_group+0xf2/0x520 [btrfs]
[583246.371243] btrfs_relocate_block_group+0x9a9/0x22e0 [btrfs]
[583246.372443] ? preempt_count_add+0x47/0xa0
[583247.532978] ? btrfs_tree_read_lock_nested+0x19/0x90 [btrfs]
[583247.534520] ? mutex_lock+0x1a/0x40
[583247.602233] ? btrfs_scrub_pause+0x2e/0x120 [btrfs]
[583247.603543] btrfs_relocate_chunk+0x3b/0x1a0 [btrfs]
[583247.604893] btrfs_balance+0x9d5/0x1920 [btrfs]
[583247.606189] ? preempt_count_add+0x69/0xa0
[583247.607030] btrfs_ioctl+0x260c/0x2a20 [btrfs]
[583247.608015] ? __memcg_slab_free_hook+0x156/0x1a0
[583247.636971] __x64_sys_ioctl+0x92/0xe0
[583247.679247] do_syscall_64+0x60/0xf20
[583247.753297] ? clear_bhb_loop+0x60/0xb0
[583247.756321] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[583247.787018] RIP: 0033:0x7f9a5186a8db
[583247.787787] Code: 00 48 89 (...)
[583247.791410] RSP: 002b:00007fff2ffa6ac0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[583247.792897] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9a5186a8db
[583247.794319] RDX: 00007fff2ffa6bb0 RSI: 00000000c4009420 RDI: 0000000000000003
[583247.795714] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[583247.797149] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff2ffa903f
[583247.798685] R13: 00007fff2ffa6bb0 R14: 0000000000000002 R15: 0000000000000002
[583247.800136] </TASK>
So update all simple assertions in backref.c to print out the values when
they aren't testing simple boolean conditions.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 7af30ba commit c4e7778
1 file changed
Lines changed: 19 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
| 1259 | + | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
| |||
1327 | 1327 | | |
1328 | 1328 | | |
1329 | 1329 | | |
1330 | | - | |
| 1330 | + | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | 1333 | | |
| |||
2964 | 2964 | | |
2965 | 2965 | | |
2966 | 2966 | | |
2967 | | - | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2968 | 2970 | | |
2969 | 2971 | | |
2970 | 2972 | | |
| |||
3030 | 3032 | | |
3031 | 3033 | | |
3032 | 3034 | | |
3033 | | - | |
| 3035 | + | |
3034 | 3036 | | |
3035 | 3037 | | |
3036 | 3038 | | |
| |||
3052 | 3054 | | |
3053 | 3055 | | |
3054 | 3056 | | |
3055 | | - | |
| 3057 | + | |
3056 | 3058 | | |
3057 | 3059 | | |
3058 | 3060 | | |
| |||
3155 | 3157 | | |
3156 | 3158 | | |
3157 | 3159 | | |
3158 | | - | |
3159 | | - | |
| 3160 | + | |
| 3161 | + | |
3160 | 3162 | | |
3161 | 3163 | | |
3162 | 3164 | | |
3163 | 3165 | | |
3164 | 3166 | | |
3165 | 3167 | | |
3166 | | - | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
3167 | 3172 | | |
3168 | 3173 | | |
3169 | 3174 | | |
| |||
3283 | 3288 | | |
3284 | 3289 | | |
3285 | 3290 | | |
3286 | | - | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
3287 | 3294 | | |
3288 | 3295 | | |
3289 | 3296 | | |
| |||
3333 | 3340 | | |
3334 | 3341 | | |
3335 | 3342 | | |
3336 | | - | |
3337 | | - | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
3338 | 3346 | | |
3339 | 3347 | | |
3340 | 3348 | | |
| |||
0 commit comments