diff options
author | Jon Derrick <jonathan.derrick@linux.dev> | 2023-02-24 11:33:22 -0700 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2023-04-13 22:20:24 -0700 |
commit | 10172f200b67aafcb9b8ce7d0575d713c1aafbb7 (patch) | |
tree | 06f77774f5aa2ef9d4b970343d61873123c6ce09 /drivers/md/raid0.c | |
parent | 328e17d8d9428b390ab48bdedcaf5106e4b511fe (diff) |
md: Fix types in sb writer
Page->index is a pgoff_t and multiplying could cause overflows on a
32-bit architecture. In the sb writer, this is used to calculate and
verify the sector being used, and is multiplied by a sector value. Using
sector_t will cast it to a u64 type and is the more appropriate type for
the unit. Additionally, the integer size unit is converted to a sector
unit in later calculations, and is now corrected to be an unsigned type.
Finally, clean up the calculations using variable aliases to improve
readabiliy.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jon Derrick <jonathan.derrick@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230224183323.638-3-jonathan.derrick@linux.dev
Diffstat (limited to 'drivers/md/raid0.c')
0 files changed, 0 insertions, 0 deletions