Subject: To stick or not to stick [ disklabels ]
To: None <tech-kern@netbsd.org>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 12/09/1999 10:27:04
A proposal to handle sticky disklabels in the current disklabeling sceme:

Add an ioctl, DIOCSTICK, that take a boolean argument. When false, drop
the disklabel on the next full close, when true, retain the disklabel.

For sd.c, this can be implemented by defining an SDEV_STICKY_LABEL flag
and changing the end of sdclose() to something like:

        if (sd->sc_dk.dk_openmask == 0) {

		.....

                scsipi_wait_drain(sd->sc_link);

                scsipi_prevent(sd->sc_link, PR_ALLOW,
                    XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
                sd->sc_link->flags &= ~SDEV_OPEN;

    ->          if (! (sd->sc_link->flags & SDEV_STICKY_LABEL))
    ->              sd->sc_link->flags &= ~SDEV_MEDIA_LOADED;

                scsipi_wait_drain(sd->sc_link);

                scsipi_adapter_delref(sd->sc_link);
        }


For wd.c, something simular can be done.

Are there objections against the above change?

Leo.