Commit 50c134f
btrfs: move WARN_ON on unexpected error in __add_tree_block()
There's no point in having the WARN_ON(1) inside the if statement for the
unexpected error. Move it into the if statement's condition, which brings
a couple benefits:
1) It marks the branch as unlikely, hinting the compiler to generate
better code;
2) The WARN_ON() produces a stack trace after the dumped leaf and error
message which can hide that more important information in case we get
a truncated dmesg/syslog.
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 f51228e commit 50c134f
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3200 | 3200 | | |
3201 | 3201 | | |
3202 | 3202 | | |
3203 | | - | |
| 3203 | + | |
3204 | 3204 | | |
3205 | 3205 | | |
3206 | 3206 | | |
3207 | 3207 | | |
3208 | 3208 | | |
3209 | | - | |
3210 | 3209 | | |
3211 | 3210 | | |
3212 | 3211 | | |
| |||
0 commit comments