On Sunday March 10, mblack@csi.cc wrote: > I'm working on a 2TB array RAID5 setup (and very slowly making progress I > might add with all the oopses and SCSI errors). At least I solved this > small problem though. > > Using Linux-2.4.19-pre2-ac3 and mdadm-0.7 > > mdadm --detail gives a bogus "Array Size". Also, the "human_size" value is > calculated wrong since both "Array Size" and "Device Size" are in 1024 byte > units already and not 1000 byte units. The "human_size" is given as MiB or GiB (Mebibytes or Gibibytes) and so a multiples if 2^20 or 2^30. Presumably you were expecting SI Megabytes or Gigabytes (10^6, 10^9), which I guess we could do as well. > I changed Detail.c to use BLKGETSIZE64 but noticed that this returns a much > larger number due to this line in md.c: > case BLKGETSIZE64: /* Return device size */ > err = md_put_user((u64)md_hd_struct[minor].nr_sects > << 9, > (u64 *) arg); > Why are we multiplying by 512??? Seems unnecessary to me. BLKGETSIZE returns sectors. BLKGETSIZE64 returns bytes. Bytes are a much more sensible unit to use, if you have space for it. BLKGETSIZE64 has enough space, so uses bytes. > > Anyway -- the following mods (also attached) are necessary for mdadm to > print out the correct answer (and it prints out correctly for all of my RAID > sets): Thanks. Please always use "diff -u", it is much more readable. But I will probably apply this stuff by hand. Thanks. NeilBrown - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html