Thread (3 messages) 3 messages, 2 authors, 2021-09-24

Re: [PATCH v2 1/2] btrfs: make sure btrfs_io_context::fs_info is always initialized

From: David Sterba <hidden>
Date: 2021-09-24 12:47:22

On Fri, Sep 24, 2021 at 01:30:52PM +0800, Qu Wenruo wrote:
Currently btrfs_io_context::fs_info is only initialized in
btrfs_map_bio(), but there are call sites like btrfs_map_sblock()
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().

Reviewed-by: Nikolay Borisov <redacted>
Signed-off-by: Qu Wenruo <redacted>
---
Changelog:
v2:
- Fix the wrong function name in the commit message
I fixed that in v1 already, but made sure v2 is the same code-wise. Now
in misc-next, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help