<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
</head><body><p class="default-style">hello,<br>some hours i have looked for any changes and issues existing to this already, but did not found any. which is hopefully correct.<br> <br>PATCH V2 12/12 (2017-12-08 10:59:57 -050) introduced<br>_check_data_dev_sectors in raid.c</p><p class="default-style">Calculation in there uses<br>to_sector(unsigned long n)</p><p class="default-style">of a loff_t value returned by  used i_size_read routine. Which is a long long type afaik. At a LP32 system, this results in a wrong value and intended check fails, which is expected to be wrong. At LP64, it should work of course. See example values at a used system (arm 32bit, 862GB raid1) below.</p><p class="default-style">I might be wrong, if there is, may you please provide a hint to me how to proceed here? Currently, there's no perfect patch available here, just started investigating the source due to this behavior.</p><p class="default-style">Thanks a lot & regards,<br>Jörg</p><p class="default-style"><br>the said example,at system<br></p><p class="default-style">Linux gonzales 4.18.0-gentoo #3 SMP PREEMPT Wed Aug 15 15:33:45 CEST 2018 armv7l ARMv7 Processor rev 3 (v7l) SAMSUNG EXYNOS (Flattened Device Tree) GNU/Linux</p><p class="default-style">the outputs i'd added<br>[ 49.004135] device-mapper: raid: _check_data_dev_sectors<br>[ 49.004149] device-mapper: raid: sizeof(sector_t) 8<br>[ 49.004161] device-mapper: raid: sizeof(unsigned long) 4<br>[ 49.004206] device-mapper: raid: md.dev_sectors 1809793024, that is 926614028288 bytes<br>[ 49.004242] device-mapper: raid: rdev->sectors 1809793024, that is 926614028288 bytes<br>[ 49.004317] device-mapper: raid: i_size_read(rdev->bdev->bd_inode) returns 926614028288<br>[ 49.004327] device-mapper: raid: i_size_read(rdev->bdev->bd_inode) >> 9 is 1809793024<br>[ 49.004337] device-mapper: raid: to_sector(i_size_read(rdev->bdev->bd_inode)) returns 6242304<br>[ 49.004346] device-mapper: raid: ds is 6242304<br>[ 49.004356] device-mapper: raid: Error<br></p></body></html>