summaryrefslogtreecommitdiff
path: root/lib/check_signature.c
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>2022-08-26 10:42:15 +0300
committerDavid Sterba <dsterba@suse.com>2022-09-05 16:32:26 +0300
commitcac5c44c48c9fb9cc31bea15ebd9ef0c6462314f (patch)
treedab3026219e586f635378cacca2ca69eee156c5c /lib/check_signature.c
parentd5b81ced74afded85619ffbbe9c32ba9d82c9b1e (diff)
downloadlinux-cac5c44c48c9fb9cc31bea15ebd9ef0c6462314f.tar.xz
btrfs: zoned: set pseudo max append zone limit in zone emulation mode
The commit 7d7672bc5d10 ("btrfs: convert count_max_extents() to use fs_info->max_extent_size") introduced a division by fs_info->max_extent_size. This max_extent_size is initialized with max zone append limit size of the device btrfs runs on. However, in zone emulation mode, the device is not zoned then its zone append limit is zero. This resulted in zero value of fs_info->max_extent_size and caused zero division error. Fix the error by setting non-zero pseudo value to max append zone limit in zone emulation mode. Set the pseudo value based on max_segments as suggested in the commit c2ae7b772ef4 ("btrfs: zoned: revive max_zone_append_bytes"). Fixes: 7d7672bc5d10 ("btrfs: convert count_max_extents() to use fs_info->max_extent_size") CC: stable@vger.kernel.org # 5.12+ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'lib/check_signature.c')
0 files changed, 0 insertions, 0 deletions