Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: fix chunk map leak in btrfs_map_block() after btrfs_translate_remap()

If the call to btrfs_translate_remap() in btrfs_map_block() returns an
error code, we were leaking the chunk map. Fix it by jumping to out
rather than returning directly.

Reported-by: Chris Mason <clm@fb.com>
Link: https://lore.kernel.org/linux-btrfs/20260125125830.2352988-1-clm@meta.com/
Fixes: 18ba64992871 ("btrfs: redirect I/O for remapped block groups")
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Mark Harmstone and committed by
David Sterba
54b9395b f15fb3d4

+1 -1
+1 -1
fs/btrfs/volumes.c
··· 6907 6907 6908 6908 ret = btrfs_translate_remap(fs_info, &new_logical, length); 6909 6909 if (ret) 6910 - return ret; 6910 + goto out; 6911 6911 6912 6912 if (new_logical != logical) { 6913 6913 btrfs_free_chunk_map(map);