Commit 7467bc5
btrfs: zoned: calculate max_extent_size properly on non-zoned setup
Since commit 559218d ("block: pre-calculate max_zone_append_sectors"),
queue_limits's max_zone_append_sectors is default to be 0 and it is only
updated when there is a zoned device. So, we have
lim->max_zone_append_sectors = 0 when there is no zoned device in the
filesystem.
That leads to fs_info->max_zone_append_size and thus
fs_info->max_extent_size to be 0, which is wrong and can for example
lead to a divide by zero in count_max_extents().
Fix this by only capping fs_info->max_extent_size to
fs_info->max_zone_append_size when it is non-zero.
Based on a patch from Naohiro Aota <[email protected]>, from which
much of this commit message is stolen as well.
Reported-by: Shinichiro Kawasaki <[email protected]>
Fixes: 559218d ("block: pre-calculate max_zone_append_sectors")
Tested-by: Shinichiro Kawasaki <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Naohiro Aota <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 6aecd91 commit 7467bc5
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
749 | | - | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| |||
0 commit comments