Skip to content

Commit 7996101

Browse files
Liu BoSomasundaram Krishnasamy
authored andcommitted
Btrfs: add WARN_ONCE to detect unexpected error from merge_extent_mapping
Orabug: 27446653 This is a subtle case, so in order to understand the problem, it'd be good to know the content of existing and em when any error occurs. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 23c4891 commit 7996101

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/btrfs/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7227,11 +7227,14 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
72277227
*/
72287228
err = merge_extent_mapping(em_tree, existing,
72297229
em, start);
7230-
free_extent_map(existing);
72317230
if (err) {
7231+
WARN_ONCE(1, "existing (0x%llx 0x%llx 0x%llx) em (0x%llx 0x%llx 0x%llx)\n",
7232+
existing->start, existing->len, existing->block_start,
7233+
em->start, em->len, em->block_start);
72327234
free_extent_map(em);
72337235
em = NULL;
72347236
}
7237+
free_extent_map(existing);
72357238
} else {
72367239
free_extent_map(em);
72377240
em = existing;

0 commit comments

Comments
 (0)