aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-imx.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <[email protected]>2023-02-21 10:11:24 -0800
committerDavid Sterba <[email protected]>2023-03-06 19:28:19 +0100
commit95cd356ca23c3807b5f3503687161e216b1c520d (patch)
tree9003d6497b7c456801954b39430a896b6b201e67 /drivers/usb/cdns3/cdns3-imx.c
parent98e8d36a26c2ed22f78316df7d4bf33e554b9f9f (diff)
btrfs: fix percent calculation for bg reclaim message
We have a report, that the info message for block-group reclaim is crossing the 100% used mark. This is happening as we were truncating the divisor for the division (the block_group->length) to a 32bit value. Fix this by using div64_u64() to not truncate the divisor. In the worst case, it can lead to a div by zero error and should be possible to trigger on 4 disks RAID0, and each device is large enough: $ mkfs.btrfs -f /dev/test/scratch[1234] -m raid1 -d raid0 btrfs-progs v6.1 [...] Filesystem size: 40.00GiB Block group profiles: Data: RAID0 4.00GiB <<< Metadata: RAID1 256.00MiB System: RAID1 8.00MiB Reported-by: Forza <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Fixes: 5f93e776c673 ("btrfs: zoned: print unusable percentage when reclaiming block groups") CC: [email protected] # 5.15+ Reviewed-by: Anand Jain <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: David Sterba <[email protected]> [ add Qu's note ] Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-imx.c')
0 files changed, 0 insertions, 0 deletions