btrfs: zoned: initialize device's zone info for seeding
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Fri, 4 Nov 2022 14:12:34 +0000 (07:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:58:27 +0000 (09:58 +0100)
commit91c38504e589dadbcde47b1cacdfc5b684154d44
tree5e1d2fb450c0415aeeddfd68968d49502fd8baa3
parent432c30ba3f56e16cf8f2adc5aac80b4553ef7c6c
btrfs: zoned: initialize device's zone info for seeding

commit a8d1b1647bf8244a5f270538e9e636e2657fffa3 upstream.

When performing seeding on a zoned filesystem it is necessary to
initialize each zoned device's btrfs_zoned_device_info structure,
otherwise mounting the filesystem will cause a NULL pointer dereference.

This was uncovered by fstests' testcase btrfs/163.

CC: stable@vger.kernel.org # 5.15+
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h