From: Guoqing Jiang Date: Wed, 16 Dec 2020 01:26:22 +0000 (+0100) Subject: md/raid5: cast chunk_sectors to sector_t value X-Git-Tag: v5.15~1756^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5eec74f252dfba25269cd68f9a3407aedefd330;p=platform%2Fkernel%2Flinux-starfive.git md/raid5: cast chunk_sectors to sector_t value Currently, raid5 calculates dev_sectors from chunk_sectors without proper cast, which is problematic. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index f411b9e..b71f501 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -7661,7 +7661,7 @@ static int raid5_run(struct mddev *mddev) } /* device size must be a multiple of chunk size */ - mddev->dev_sectors &= ~(mddev->chunk_sectors - 1); + mddev->dev_sectors &= ~((sector_t)mddev->chunk_sectors - 1); mddev->resync_max_sectors = mddev->dev_sectors; if (mddev->degraded > dirty_parity_disks &&