Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Guoqing Jiang and committed by
Song Liu
c5eec74f 0d738971

+1 -1
+1 -1
drivers/md/raid5.c
··· 7661 7661 } 7662 7662 7663 7663 /* device size must be a multiple of chunk size */ 7664 - mddev->dev_sectors &= ~(mddev->chunk_sectors - 1); 7664 + mddev->dev_sectors &= ~((sector_t)mddev->chunk_sectors - 1); 7665 7665 mddev->resync_max_sectors = mddev->dev_sectors; 7666 7666 7667 7667 if (mddev->degraded > dirty_parity_disks &&