mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
Btrfs: don't print the leaf if we had an error
In __btrfs_free_extent we will print the leaf if we fail to find the extent we wanted, but the problem is if we get an error we won't have a leaf so often this leads to a NULL pointer dereference and we lose the error that actually occurred. So only print the leaf if ret > 0, which means we didn't find the item we were looking for but we didn't error either. This way the error is preserved. Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
bf5f32ecb6
commit
b783e62d96
1 changed files with 3 additions and 1 deletions
|
@ -4462,7 +4462,9 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
|
|||
printk(KERN_ERR "umm, got %d back from search"
|
||||
", was looking for %llu\n", ret,
|
||||
(unsigned long long)bytenr);
|
||||
btrfs_print_leaf(extent_root, path->nodes[0]);
|
||||
if (ret > 0)
|
||||
btrfs_print_leaf(extent_root,
|
||||
path->nodes[0]);
|
||||
}
|
||||
BUG_ON(ret);
|
||||
extent_slot = path->slots[0];
|
||||
|
|
Loading…
Reference in a new issue