Commit 44ae4b6
btrfs-progs: do not dump leaf if the path is released inside __free_extent()
[BUG]
There is a bug report that btrfs-convert crashed during converting an
ext4 image which is almost full.
[CAUSE]
Just before the crash, btrfs-convert is committing the current
transaction but failed to locate the backref inside __free_extent().
Then it went through the error handling path, which printed an error
message and tried to dump the leaf.
But in this particular case, the error code is not -ENOENT, thus the
path is already released, resulting path->nodes[0] to be NULL, and
btrfs_print_leaf() triggers a NULL pointer dereference.
[FIX]
The kernel version of btrfs_free_extent() is only dumping the tree for
-ENOENT error code. And patch "btrfs: refactor the error handling of
__btrfs_free_extent()" was submitted to make abort_and_dump() to only
dump the leaf if the path is not released.
So follow the same kernel patch, by only dumping the leaf if the path is
not released.
Issue: #1064
Pull-request: #1065
Signed-off-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent c8b60ca commit 44ae4b6
File tree
1 file changed
+4
-2
lines changed1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2058 | 2058 | | |
2059 | 2059 | | |
2060 | 2060 | | |
2061 | | - | |
2062 | | - | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2063 | 2065 | | |
2064 | 2066 | | |
2065 | 2067 | | |
| |||
0 commit comments