summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>2020-12-16 02:26:22 +0100
committerSong Liu <songliubraving@fb.com>2021-02-03 22:48:16 -0800
commitc5eec74f252dfba25269cd68f9a3407aedefd330 (patch)
tree1a9dfff1bf05650e57121e2d14b010177da4cf6f /drivers/md/raid5.c
parent0d7389718c32ad6bb8bee7895c91e2418b6b26aa (diff)
downloadlinux-c5eec74f252dfba25269cd68f9a3407aedefd330.tar.bz2
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 <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f411b9e5c332..b71f50132495 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 &&