Re: [PATCH 1/2] btrfs: make sure btrfs_io_context::fs_info is always initialized
From: Nikolay Borisov <hidden>
Date: 2021-09-23 08:36:35
From: Nikolay Borisov <hidden>
Date: 2021-09-23 08:36:35
On 23.09.21 г. 9:00, Qu Wenruo wrote:
Currently btrfs_io_context::fs_info is only initialized in btrfs_map_block(), but there are call sites like btrfs_map_sblock()
s/btrfs_map_block/btrfs_map_bio and indeed this is done across function boundaries which is ugly as hell.
which calls __btrfs_map_block() directly, leaving bioc::fs_info uninitialized (NULL). Currently this is fine, but later cleanup will rely on bioc::fs_info to grab fs_info, and this can be a hidden problem for such usage. This patch will remove such hidden uninitialized member by always assigning bioc::fs_info at alloc_btrfs_io_context(). Signed-off-by: Qu Wenruo <redacted>
With the changelog change so that it's consistent with the changed code: Reviewed-by: Nikolay Borisov <redacted>