Hi all! Our company had been working on a project for a customer and faced the following problem: One line summary of the problem: Kernel detects wrong partitions sizes for large volume with APM partition table. Full description of the problem/report: When using 2+ TB volume with APM partition table and one of the partitions on it (also may be single partition) of size 2+ TB, one can notice that (for example block device is sdb) '/sys/block/sdb/size' contains significantly different (with factor greater than 2) size than the sum of all '/sys/block/sdb/sdb*/size' The problem is in block/partitions/mac.c source: in function int mac_partition(struct parsed_partitions *state) the declaration of 'secsize' variable is 'unsigned secsize', but should be 'sector_t secsize' Keywords: APM, kernel, block, mac, sector_t, secsize All significant environment information you could find in attachments (env.txt) But the bug also appears in the latest upstream kernel: http://lxr.free-electrons.com/source/block/partitions/mac.c#L35 A small shell script or example program which triggers the problem Bug could be reproduced by two shell commands: i=0; for f in /sys/block/sdb/sdb*/size; do let i=$i+`cat $f`; done; echo $i cat /sys/block/sdb/size The result is two significantly different numbers. Simple fix: replace 'unsigned secsize' with 'sector_t secsize' (*.patch in attachements) in block/partition/mac.c -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html