Skip to content
Commit 0bdb50c5 authored by NeilBrown's avatar NeilBrown Committed by Mike Snitzer
Browse files

dm: fix to_sector() for 32bit



A dm-raid array with devices larger than 4GB won't assemble on
a 32 bit host since _check_data_dev_sectors() was added in 4.16.
This is because to_sector() treats its argument as an "unsigned long"
which is 32bits (4GB) on a 32bit host.  Using "unsigned long long"
is more correct.

Kernels as early as 4.2 can have other problems due to to_sector()
being used on the size of a device.

Fixes: 0cf45031 ("dm raid: add support for the MD RAID0 personality")
cc: stable@vger.kernel.org (v4.2+)
Reported-and-tested-by: default avatarGuillaume Perréal <gperreal@free.fr>
Signed-off-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent d2832376
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment