From jkh@mimsy.cdrom.com  Thu Nov 30 10:59:48 1995
Received: from mimsy.cdrom.com (mimsy.cdrom.com [192.216.223.173])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id KAA11526
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 30 Nov 1995 10:59:48 -0800
Received: (from root@localhost) by mimsy.cdrom.com (8.6.11/8.6.9) id KAA01336; Thu, 30 Nov 1995 10:59:47 -0800
Message-Id: <199511301859.KAA01336@mimsy.cdrom.com>
Date: Thu, 30 Nov 1995 10:59:47 -0800
From: Jordan Hubbard <jkh@mimsy.cdrom.com>
Reply-To: jkh@mimsy.cdrom.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: swapinfo shows incorrect information for vnconfig'd swap.
X-Send-Pr-Version: 3.2

>Number:         854
>Category:       bin
>Synopsis:       swapinfo shows incorrect information for vnconfig'd swap.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 30 11:00:01 PST 1995
>Closed-Date:    Sun Aug 5 01:43:08 PDT 2001
>Last-Modified:  Sun Aug 05 01:44:05 PDT 2001
>Originator:     Jordan Hubbard
>Release:        FreeBSD 2.1-STABLE
>Organization:
FreeBSD Project
>Environment:

>Description:

On a system with swap space added via vnconfig, swapinfo prints an
entry like this for the vn0 device:

/dev/??         65536        0    65472     0%    Interleaved

>How-To-Repeat:

        dd if=/dev/zero of=/usr/swapfile bs=4k count=16384
        vnconfig /dev/vn1 /usr/swapfile
        swapon /dev/vn1
>Fix:
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@freebsd.org, jkh@mimsy.cdrom.com
Cc:  Subject: Re: bin/854: swapinfo shows incorrect information for vnconfig'd swap.
Date: Fri, 1 Dec 1995 23:06:21 +1100

 >On a system with swap space added via vnconfig, swapinfo prints an
 >entry like this for the vn0 device:
 
 >/dev/??         65536        0    65472     0%    Interleaved
 
 >>How-To-Repeat:
 
 >        dd if=/dev/zero of=/usr/swapfile bs=4k count=16384
 >        vnconfig /dev/vn1 /usr/swapfile
                          ^0
 >        swapon /dev/vn1
                        ^0
 
 This is probably because you don't have /dev/vn0b and/or because you
 didn't specify swapping on the `b' partition.  Unless slicing is enabled,
 the slice _and_ partition bits in the minor number are ignored, so
 /dev/vn0 is a bogus alias for /dev/vn0b and swapping on /dev/vn0 may
 work for bogus reasons.
 
 If slicing is enabled, then vnsize() is broken - it returns the full
 size, not the partition size.
 
 Bruce
Responsible-Changed-From-To: freebsd-bugs->dyson 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Sep 18 14:42:22 PDT 1996 
Responsible-Changed-Why:  
John work on swapon/swapoff 
Responsible-Changed-From-To: dyson->dg 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Jun 17 15:16:02 MEST 1998 
Responsible-Changed-Why:  
John Dyson has resigned from the FreeBSD project. 
State-Changed-From-To: open->analyzed 
State-Changed-By: asmodai 
State-Changed-When: Sun Jun 11 01:53:57 PDT 2000 
State-Changed-Why:  
I looked at the PR in some detail and can confirm some of this. 

The first vn device used will be vn0b, logically. 

However, when you use more vn devices for swapon, swapinfo will reply 
with: 

[17:50] [root@daemon] (26) # swapinfo 
Device          1K-blocks     Used    Avail Capacity  Type 
/dev/da0s1b        262016    53440   208576    20%    Interleaved 
/dev/rvn0           65408        0    65408     0%    Interleaved 
/dev/#C43:0x1000a       -64      -64        0   100%    Interleaved 
/dev/#C43:0x10012       896        0      896     0%    Interleaved 
Total              328256    53376   274880    16% 

It shows the device major:minor instead of the device name.  The 
rest works perfectly though.  The -64 was a too small dd'd file  
I created. 

So the problem as originally reported in the PR doesn't exist 
anymore in 4.0 and onwards, and I suspect the same to be true for 
3.4-R and onwards as well. 

But I am just curious about the above. 



Responsible-Changed-From-To: dg->freebsd-bugs 
Responsible-Changed-By: asmodai 
Responsible-Changed-When: Sun Jun 11 01:53:57 PDT 2000 
Responsible-Changed-Why:  
Two years allocated, time to let the freebsd-bugs list at it 
again so that we can finally resolve this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=854 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jon 
State-Changed-When: Sun Aug 5 01:43:08 PDT 2001 
State-Changed-Why:  
Has been fixed on -STABLE.  -CURRENT no longer uses vnconfig.  md does not 
exhibit this problem. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=854 
>Unformatted:
