]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/zoned.c
btrfs: zoned: bail out if we can't read a reliable write pointer
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Fri, 30 Apr 2021 13:34:18 +0000 (15:34 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:04 +0000 (15:19 +0200)
commit06e1e7f4223c98965fb721b4b1e12083cfbe777e
treef44f39b71f5ee053f041d6153e18fc2f2079facf
parent47cdfb5e1dd60422ec2cbc53b667f73ff9a411dc
btrfs: zoned: bail out if we can't read a reliable write pointer

If we can't read a reliable write pointer from a sequential zone fail
creating the block group with an I/O error.

Also if the read write pointer is beyond the end of the respective zone,
fail the creation of the block group on this zone with an I/O error.

While this could also happen in real world scenarios with misbehaving
drives, this issue addresses a problem uncovered by fstests' test case
generic/475.

CC: stable@vger.kernel.org # 5.12+
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zoned.c