[klibc] bunch of small fixes
ncunningham at crca.org.au
Fri Mar 28 16:04:02 PDT 2008
On Fri, 2008-03-28 at 15:54 -0700, H. Peter Anvin wrote:
> Nigel Cunningham wrote:
> > Hi.
> > On Fri, 2008-03-28 at 21:32 +0100, maximilian attems wrote:
> >> hello hpa,
> >> updated/rebased my klibc merge branch.
> >> David critized the toxonice fstype support due to the
> >> missing real MAGIC of tuxonice. I agree that "z" and "Z"
> >> leaves too much room for misrecognition thus patch dropped.
> >> added a quick utils cleanup and a mknod switch.
> > Thanks for cc'ing me. The reason it is just a 'z' or 'Z' is that it
> > hasn't changed since the days when we had to fit major & minor numbers,
> > a block and the block size. (There simply wasn't room for anything more
> > than one character). Since you've raised the issue, I've had another
> > look. The format is currently:
> > Byte 0: z/Z: Original swapspace type.
> > 1-4: dev_t for first block of header
> > 5: blocksize - top bit = whether previously attempted to resume
> > 6-9: index of first block of header
> > The dev_t is necessary because (unlike [u]swsusp), we support using
> > multiple swap devices for storing the image, so the header might start
> > on a different partition to the swapspace signature.
> > Clearly there are some unused bits in there now. How about if I
> > rearranged things:
> > Bytes 0-1: Signature ascii tx with the high bit on in
> > Byte 0 if the original signature was SWAPSPACE2.
> > Byte 1 if we tried to resume before.
> > 2-5: dev_t for first block of header
> > 6-9: index for first block of header
> > Would that help address the potential misrecognition issue?
> Well, two bytes is better than one (and non-ASCII is better than ASCII),
> but it's still anemic. I'm recommending that people use 64-bit magics
> these days.
Okay. On further reflection, I suppose I don't need to bother with just
using the signature, so long as I can restore whatever is overwritten.
Based on that, how about if we say that the signature will start with
'TUXONICE' (without the quotes) regardless of what the original
signature was. I'll store the info that was there elsewhere in that
block, and put the original contents in the header proper.
This will apply from the next (3.0-rc6) release.
More information about the klibc