From root@spitfire.303.krakow.pl  Sat Mar 16 12:53:45 2002
Return-Path: <root@spitfire.303.krakow.pl>
Received: from spitfire.303.krakow.pl (spitfire.303.krakow.pl [62.233.208.97])
	by hub.freebsd.org (Postfix) with SMTP id 92B3237B422
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 16 Mar 2002 12:53:44 -0800 (PST)
Received: (qmail 24990 invoked by uid 0); 16 Mar 2002 20:53:36 -0000
Message-Id: <20020316205335.24989.qmail@spitfire.303.krakow.pl>
Date: 16 Mar 2002 20:53:35 -0000
From: Jan Srzednicki <winfried@dream.vg>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: swap double mount
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35985
>Category:       bin
>Synopsis:       sysinstall(8): swap double mount
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 16 13:00:01 PST 2002
>Closed-Date:    Sun Apr 25 11:22:49 UTC 2010
>Last-Modified:  Sun Apr 25 11:22:49 UTC 2010
>Originator:     Jan Srzednicki
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Dywizjonet
>Environment:
System: FreeBSD spitfire.303.krakow.pl 4.5-STABLE FreeBSD 4.5-STABLE #2: Tue Feb 12 11:42:41 CET 2002 i386


	
>Description:

I installed a new disk in my machine, run disklabel from /stand/sysinstall,
did some stuff, and run disklabel once more, for a second slice.
Then the system begun to be unstable, some things kept getting SEGVs and stuff:

Mar 16 20:53:02 spitfire /kernel: pid 149 (httpd), uid 0: exited on signal 11 (core dumped)
Mar 16 21:41:07 spitfire /kernel: pid 715 (irssi), uid 1001: exited on signal 11(core dumped)
(..)
And so on.

I had no idea what was going on until I typed swapinfo:

[21:46] spitfire:~(60)# swapinfo
Device          1K-blocks     Used    Avail Capacity  Type
/dev/ad0s1b        153472     5036   148436     3%    Interleaved
/dev/rad6s1b       204672     4968   199704     2%    Interleaved
/dev/rad4s1b       348032     4972   343060     1%    Interleaved
/dev/rad4s1b       348032     1580   346452     0%    Interleaved
Total             1054208    16556  1037652     2%

Aaargh! /dev/rad4s1b is mounted as swap twice!
I thing the system should never allow this to happen.

>How-To-Repeat:

Like I described earlier.

>Fix:


>Release-Note:
>Audit-Trail:

From: "Crist J. Clark" <cjc@FreeBSD.ORG>
To: Jan Srzednicki <winfried@dream.vg>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/35985: swap double mount
Date: Sun, 17 Mar 2002 02:03:13 -0800

 On Sat, Mar 16, 2002 at 08:53:35PM -0000, Jan Srzednicki wrote:
 [snip]
 
 > [21:46] spitfire:~(60)# swapinfo
 > Device          1K-blocks     Used    Avail Capacity  Type
 > /dev/ad0s1b        153472     5036   148436     3%    Interleaved
 > /dev/rad6s1b       204672     4968   199704     2%    Interleaved
 > /dev/rad4s1b       348032     4972   343060     1%    Interleaved
 > /dev/rad4s1b       348032     1580   346452     0%    Interleaved
 > Total             1054208    16556  1037652     2%
 > 
 > Aaargh! /dev/rad4s1b is mounted as swap twice!
 > I thing the system should never allow this to happen.
 
 It isn't supposed to. swapon(2) (the system call, not the command)
 should return EBUSY when a device is in use. Can you give more
 detailed information about how the system got into this state?
 -- 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
State-Changed-From-To: open->feedback 
State-Changed-By: cjc 
State-Changed-When: Sun Mar 17 02:17:04 PST 2002 
State-Changed-Why:  
Need more information from submitter on how to reproduce the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35985 

From: "Crist J. Clark" <crist.clark@attbi.com>
To: Jan Srzednicki <winfried@dream.vg>
Cc: bug-followup@freebsd.org
Subject: Re: kern/35985: swap double mount
Date: Sun, 17 Mar 2002 03:00:02 -0800

 On Sun, Mar 17, 2002 at 11:09:25AM +0100, Jan Srzednicki wrote:
 > On Sun, 17 Mar 2002, Crist J. Clark wrote:
 > 
 > > It isn't supposed to. swapon(2) (the system call, not the command)
 > > should return EBUSY when a device is in use. Can you give more
 > > detailed information about how the system got into this state?
 > 
 > By running disklabel from /stand/sysinstall (to partition the second slice
 > on the disk) while this swap device was already mounted (it is on the
 > first slice).
 
 Cool. It does do that. Weird.
 -- 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
State-Changed-From-To: feedback->analyzed 
State-Changed-By: cjc 
State-Changed-When: Sun Mar 17 03:00:08 PST 2002 
State-Changed-Why:  
The problem is easily reproduced as described. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35985 
Responsible-Changed-From-To: freebsd-bugs->re 
Responsible-Changed-By: cjc 
Responsible-Changed-When: Mon Mar 18 21:27:39 PST 2002 
Responsible-Changed-Why:  
This might be a sysinstall(8) issue or could be a more general issue 
with the swapon(2) call. Someone who knows sysinstall(8) needs to 
figure that out. Pass to re@ as the sysinstall(8) maintainer.  

http://www.freebsd.org/cgi/query-pr.cgi?pr=35985 
Responsible-Changed-From-To: re->freebsd-qa 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Nov 21 01:53:01 GMT 2004 
Responsible-Changed-Why:  
This may be a sysinstall problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35985 
State-Changed-From-To: analyzed->closed 
State-Changed-By: brucec 
State-Changed-When: Sun Apr 25 11:20:38 UTC 2010 
State-Changed-Why:  
This issue appears to have been fixed some time between 4.5 and 6.3: I'm  
unable to replicate the bug on 6.3; sysinstall correctly reports that  
the device is busy. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35985 
>Unformatted:
