Subject: Re: How can I force a reload of the disklabel?
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 12/07/1999 09:34:23
Leo Weppelman writes

> Since the close functions of sd & wd do no longer invalidate the
> disklabel, I wonder what the proposed method for forcing a reload is.

Last time this came up (which was probably me noticing it because of
sunlabel, a vaguely-analogous program of mine for Sun-style
disklabels), someone (cgd, I think) said that not invalidating the
label on last close was broken.  I agree, but it seems nobody has
actually done anything to fix it.

Personally, what I've been doing is using scsictl detach and then
scsictl scan.  This does need patches to add scsictl detach, but I can
send a shar of those to anyone who wants.  This doesn't help with wd,
though.

Personally, I'd say the right thing to do is to make last-close
invalidate the disklabel.  I think this means either clearing
SDEV_MEDIA_LOADED in sdclose() or having sdopen() call sdgetdisklabel()
on any first open...presumably with analogous changes to the wd driver.

> Any ideas of how to (temporarely?) fix it?

> I can think of:
>    - make edahdi reboot the system (Ugh!)
>    - let an eject-ioctl on a fixed disk cause media-loaded to dropped (hacky)

   - clear media-loaded on last close

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B