@@ -397,6 +397,7 @@ static int migrate_one_reserved_range(struct btrfs_trans_handle *trans,
}
eb->start = key.objectid;
eb->len = key.offset;
+ eb->fs_info = root->fs_info;
/* Write the data */
ret = write_and_map_eb(root->fs_info, eb);
@@ -2567,6 +2567,7 @@ static int split_eb_for_raid56(struct btrfs_fs_info *info,
eb->flags = 0;
eb->fd = -1;
eb->dev_bytenr = (u64)-1;
+ eb->fs_info = info;
this_eb_start = raid_map[i];
@@ -2638,6 +2639,7 @@ int write_raid56_with_parity(struct btrfs_fs_info *info,
new_eb->fd = multi->stripes[i].dev->fd;
multi->stripes[i].dev->total_ios++;
new_eb->len = stripe_len;
+ new_eb->fs_info = info;
if (raid_map[i] == BTRFS_RAID5_P_STRIPE)
p_eb = new_eb;
@@ -397,6 +397,7 @@ again:
eb->start = first_block + bytes_read;
eb->len = sectorsize;
+ eb->fs_info = root->fs_info;
/*
* we're doing the csum before we record the extent, but
Several extent_buffer initialization misses fs_info setting. This is OK before the following patch ("btrfs-progs: use direct-io for zoned device") as eb->fs_info is not always necessary. But, after that patch, we will use fs_info to determine it is zoned or not and that causes segfault in such cases. Properly set fs_info when initializing extent_buffers to fix the issue. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> --- convert/main.c | 1 + kernel-shared/volumes.c | 2 ++ mkfs/rootdir.c | 1 + 3 files changed, 4 insertions(+)