Subject: Re: kern/22774: there is no way to swapctl -a to a wrongly typed partition
To: Alan Barrett <apb@cequrux.com>
From: Roland Dowdeswell <elric@imrryr.org>
List: netbsd-bugs
Date: 09/13/2003 17:13:34
On 1063474716 seconds since the Beginning of the UNIX epoch
Alan Barrett wrote:
>

>My patch implements something similar to your first suggested strategy.

Yeah, I've a very similar patch in my tree.

>> The decision to not allow swap directly to the raw partition is [I
>> think] quite deliberate, since it would allow typos to destroy the
>> contents of the disk.
>
>If it's deliberate, it would be nice if it were implemented via a
>deliberate test, rather than as a side effect of what looks like a bug
>in dk_size() [returning zero for the size of the raw partition of an
>unlabeled disk].

Yes, I found that a little obscure when I saw what was going on.
It is relying on the fact that the only code that calls that function
is the swap code.

>If you are worried about typos destroying disks, dd(8) can do that just
>as easily as enabling swap.

Actually, I'm not worried about typos destroying disks---I was just
following the established conventions.

Solving this problem is a good idea, but I think that we should be
consistent with the other disk devices and the established conventions
[to the largest degree possible].  I mean, I think that it would
be quite counter-intuitive if you you could swap to RAW_PART on
cgd(4) but not on sd(4) or wd(4).

--
    Roland Dowdeswell                      http://www.Imrryr.ORG/~elric/