[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210719144945.489096172@linuxfoundation.org>
Date: Mon, 19 Jul 2021 16:49:35 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Johannes Thumshirn <johannes.thumshirn@....com>,
David Sterba <dsterba@...e.com>
Subject: [PATCH 5.13 029/351] btrfs: zoned: fix types for u64 division in btrfs_reclaim_bgs_work
From: David Sterba <dsterba@...e.com>
commit 54afaae34ee49e98c1c902b444b42832551d090c upstream.
The types in calculation of the used percentage in the reclaiming
messages are both u64, though bg->length is either 1GiB (non-zoned) or
the zone size in the zoned mode. The upper limit on zone size is 8GiB so
this could theoretically overflow in the future, right now the values
fit.
Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones")
CC: stable@...r.kernel.org # 5.13
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@....com>
Signed-off-by: David Sterba <dsterba@...e.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/btrfs/block-group.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1539,7 +1539,7 @@ void btrfs_reclaim_bgs_work(struct work_
goto next;
btrfs_info(fs_info, "reclaiming chunk %llu with %llu%% used",
- bg->start, div_u64(bg->used * 100, bg->length));
+ bg->start, div64_u64(bg->used * 100, bg->length));
trace_btrfs_reclaim_block_group(bg);
ret = btrfs_relocate_chunk(fs_info, bg->start);
if (ret)
Powered by blists - more mailing lists