NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/53217: -current: dumping to wedges on GPT disks broken

The following reply was made to PR kern/53217; it has been noted by GNATS.

From: (Michael van Elst)
Subject: Re: kern/53217: -current: dumping to wedges on GPT disks broken
Date: Fri, 27 Apr 2018 15:45:28 -0000 (UTC) (Martin Husemann) writes:
 > >  In dksubr.c dkdump (not the wedge code, the general disk support) then 
 > >  examines as I quoted
 > >        796         /* Convert to disk sectors.  Request must be a 
 > >  multiple of size. */
 > >       797         part = DISKPART(dev);
 > >  ...
 > >       806         p = &lp->d_partitions[part];
 > And here accessing the label at all is clearly a bug.
 It's what the code is supposed to do. Allow dumping only on
 a swap partition (as in "disklabel partition").
 For dumping on a wedge, you have to allow dumping to the
 RAW partition. The driver's d_dump entry doesn't know wether
 it's called from dumpsys() directly, some other pseudo disk
 driver or from the wedge driver.
 To avoid surprises you can check wether the RAW partition
 is FS_UNUSED and wether the disk has actually defined wedges.
 You could still:
 - configure the raw partition as a dump device (there is no check).
 - erroneously dump to the raw partition before wedges are discovered
   or created.
                                 Michael van Elst
                                 "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index