[Tux3] Review incoming changes

Daniel Phillips phillips at phunq.net
Tue Dec 16 02:21:43 PST 2008


On Tuesday 16 December 2008 01:48, OGAWA Hirofumi wrote:
> > Clear the existent magic first, then overwrite:
> >
> >    Yes, more sensible.  Does MD really want us to clear 64 KB at the top
> >    of the volume?  That would seem rather sloppy of MD.  Really, it
> >    should rely on the just the final sector of a volume to know if it
> >    is an MD volume.
> 
> IIRC, MD RAID is using final 64kb. I think we should clear the top
> 1024bytes and final 64kb. (And with it, to make sure, we would check if
> volume size is bigger than 64kb, instead of clearing 64kb blindly.)

Here is the full story about md superblock:

   http://lxr.linux.no/linux+v2.6.27/include/linux/raid/md_p.h#L19

As I read it, the MD superblock can be as much as 128K less a byte
below the top of the volume.  It only actually uses 4K, and places that
4K at a silly place for no apparent reason.  This is really sloppy,
gross, disgusting, all that.  But it is also existing practice.  On the
other hand, if everybody has been thinking the md superblock is in the
top 64K and it actually isn't, do we do any harm by not attempting to
clear it?  I think clearing out the space below our superblock (which
we have obligingly left free in case somebody needs to put a partition
block there) is a really good idea, but not so sure about the md stuff
at the top.

> > Introduce ARRAY_SIZE():
> >
> >    This macro fits the pattern of vecset, veccpy and vecmove already
> >    in tux3.h, so we can rename it to vecsize.
> 
> The kernel has ARRAY_SIZE() already. And vec* can be pointer, but
> ARRAY_SIZE() must be real array. Actually, the kernel has more code to
> check if argument is real array.

Thankyou for saving me from introducing a bug :-)

Daniel

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list