8.0-BETA1 bsdlabel broken?

Eygene Ryabinkin rea-fbsd at codelabs.ru
Sat Jul 11 23:12:22 UTC 2009


Sun, Jul 12, 2009 at 01:16:28AM +0400, Eygene Ryabinkin wrote:
> Sat, Jul 11, 2009 at 01:39:03PM -0700, Marcel Moolenaar wrote:
> > Yes, that's the idea. I would add a safety check though:
> > even though the 'c' partition is defined and reserved to
> > mean the whole disk, there's nothing preventing creative
> > souls from using the 'c' partition for something else. I
> > would add a check to make sure that the offset of the 'c'
> > partition is less than or equal to any of the offsets in
> > the partition table before subtracting.
> 
> ...and the end of partition 'c' lies not below the end any other
> partition on this disk (so two checks will ensure that all other
> partitions are strictly enclosed within 'c') -- creative souls can make
> 'c' to come physically first (but not from the start of the slice or
> even at the start of the slice; the degree of creativeness differs
> by-case).  If there will be no such check, then, technically, there
> will be no problems -- we will add the same offset later when we'll be
> writing the label, but semantically this will be better.  Am I missing
> something?

OK, changed the patch to make the described checks.  And to fix the error
with the previous patch -- it will set the offset for writes to zero, so
it is better to use this patch variant for doing label writes and never
use the previous one for label modifications.  Though it was doing the
proper thing for reads.

But anyway, bsdlabel won't let you write the label (old, patched with
bad patch, patched with the current patch), since it wants to do it via
the BSD class and our slicer is PART.  Another patch will be submitted ;))
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
-------------- next part --------------
A non-text attachment was scrubbed...
Name: obtain-slice-offset-from-disklabel.diff
Type: text/x-diff
Size: 4091 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20090711/b3300659/obtain-slice-offset-from-disklabel-0001.bin


More information about the freebsd-current mailing list