[TEST/REVIEW] boot0cfg/fdisk issue fix

Maxim Sobolev sobomax at portaone.com
Wed Jul 6 16:58:29 GMT 2005


Poul-Henning Kamp wrote:
> In message <20050706103934.GE25722 at beatrix.daedalusnetworks.priv>, Giorgos Kera
> midas writes:
> 
> 
>>Yes, please.  Right now, there are times that sysinstall breaks in funny
>>ways when changes are made to the partition table of a disk.  The bug
>>usually shows up when one hits 'w' instead of 'q' in the slice editor.
> 
> 
> This patch does not change sysinstall, but the changes can be incorporated
> by anyone with a bit of time.

I wonder if there cound be a "better" fix. IMHO the better one would be 
to extend geom/geom_mbr to intercept attempt to rewrite MBR, check if in 
the new MBR any of the opened partitions have been changed/removed and 
simply reject write if so. Then you don't have to change any of the 
existing programs that operate on MBR.

Another good feature to have is the ability to tell geom_mbr/geom_bsd 
(via sysctl or ioctl) to make in-core copy of the table/label and 
release any locks it helds on this region, so that it can be replaced 
with completely different version if needed via simple write(2). The 
same applies to the disklabel class. This is really necessary for some 
cases, when the user or the program know he/is trying to do.

-Maxim


More information about the freebsd-current mailing list