Subject: Re: My changes to subr_disc_mbr (Was Re: default generated disklabels get overwritten?)
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 12/15/2005 00:48:44
--4jXrM3lyYWu4nBt5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Dec 15, 2005 at 12:24:03AM +0100, Manuel Bouyer wrote:
> Yes, you should have started a discussion first. Your change will cause 
> problems, see dev/isa/fd.c for example. It's probably not the only driver
> using readdisklabel this way.
> 
> > The result is that a disk driver like sys/dev/scsipi/cd.c can not create 
> > its own default label while still supporting `normal' disklabels to be on 
> > the disc. It can't determine if there is a label on the disk or not.
> 
> The real problem is that readdisklabel() can't return detailled informations
> on what happended. Sounds like you want to change its interface, with
> the error string returned in a char* passed as parameter and the return
> value being an error code with multiple values: got a label from disk,
> no label on disk (provided a fake label), error reading label from disk
> (provided a fake label), maybe more.

i can live with that. Say change to:

#define DISKLABEL_FOUND      0x0
#define DISKLABEL_FAKED      0x1
#define DISKLABEL_READERROR  0x2
#define DISKLABEL_EMULATED   0x4	/* translated `native' */

int readdisklabel(dev_t device, void (*strategy)(struct buf *bp),
                  struct disklabel *intial, struct cpu_disklabel *label
                  char **msg);

Comments?
Reinoud


--4jXrM3lyYWu4nBt5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQ6CvVYKcNwBDyKpoAQKzDAf+KHlwpX9M6W6+COFfvscynadgyf75qh2Z
jlaAQCer2+dqSG8/L/+z+NC42I8pO38rps8Drm0geWpFFWLFNEywi/+CHA09Fj/U
ANbMbvclYShAS6xTRBprQEqnJGT2LFFfOrylkrDMMCVEKe54z5CeLybeK8IwHH/F
vhi+KkAjKiy740lEctlnkvomR8/ZmngzzEvI53jLE63tqbP0uf7WaX6PNkdaUaiR
YMtaViPFM64gAqWVvnCUqdGNs3Id/Z2hOxKWaUBe3TPbvgZUeAmAchMNKZaCurKa
UnF4rqjZOymHSp8EQDiMeXTxURi7vLgnMglGitOrP3tc7ciSg2cD7A==
=5dOl
-----END PGP SIGNATURE-----

--4jXrM3lyYWu4nBt5--