]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/ctree.h
btrfs: convert count_max_extents() to use fs_info->max_extent_size
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 8 Jul 2022 23:18:41 +0000 (08:18 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:41 +0000 (17:45 +0200)
commit7d7672bc5d1038c745716c397d892d21e29de71c
treeba8befc42fc2c3980f54962f8a2944a32c3dbd87
parentf7b12a62f008a3041f42f2426983e59a6a0a3c59
btrfs: convert count_max_extents() to use fs_info->max_extent_size

If count_max_extents() uses BTRFS_MAX_EXTENT_SIZE to calculate the number
of extents needed, btrfs release the metadata reservation too much on its
way to write out the data.

Now that BTRFS_MAX_EXTENT_SIZE is replaced with fs_info->max_extent_size,
convert count_max_extents() to use it instead, and fix the calculation of
the metadata reservation.

CC: stable@vger.kernel.org # 5.12+
Fixes: d8e3fb106f39 ("btrfs: zoned: use ZONE_APPEND write for zoned mode")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/delalloc-space.c
fs/btrfs/inode.c