From starkhome!gene@sbstark.cs.sunysb.edu  Sun Jan  1 06:57:34 1995
Received: from sbstark.cs.sunysb.edu (sbstark.cs.sunysb.edu [130.245.1.47]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id GAA09762 for <FreeBSD-gnats-submit@freebsd.org>; Sun, 1 Jan 1995 06:57:33 -0800
Received: from starkhome.UUCP (root@localhost) by sbstark.cs.sunysb.edu (8.6.9/8.6.9) with UUCP id JAA02935 for FreeBSD-gnats-submit@freebsd.org; Sun, 1 Jan 1995 09:54:58 -0500
Received: by starkhome.cs.sunysb.edu (8.6.9/1.34)
	id JAA28313; Sun, 1 Jan 1995 09:56:42 -0500
Message-Id: <199501011456.JAA28313@starkhome.cs.sunysb.edu>
Date: Sun, 1 Jan 1995 09:56:42 -0500
From: starkhome!gene@sbstark.cs.sunysb.edu (Gene Stark)
Reply-To: starkhome!gene@sbstark.cs.sunysb.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Pageout panics with NFS root + local swap
X-Send-Pr-Version: 3.2

>Number:         92
>Category:       kern
>Synopsis:       Pageout panics with NFS root + local swap
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    core
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan  1 07:00:01 1995
>Closed-Date:    Sun Jan  1 07:00:01 1995
>Last-Modified:  Thu Sep 13 12:53:45 GMT 2007
>Originator:     Gene Stark
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
SUNY at Stony Brook CS Department
>Environment:

>Description:

	When booting diskless with NFS root, but no NFS swap area
	specified (local swap desired), the system panics as soon as
	pageout is attempted.

>How-To-Repeat:

	Boot diskless with NFS root, but no NFS swap space specified.
	Then run "man csh" or similarly large job causing pageout.
	The system will panic in the swap pager.

>Fix:
	
	If nd->swap_nblks is zero in nfs_mountroot(), then the system
	comes up without initializing swapdev_vp to an actual vnode pointer.
	The swap pager assumes a non-NULL value for swapdev_vp.

	The fix is to try initializing local swap if no NFS swap space
	is specified.

*** /sys/nfs/nfs_vfsops.c	Thu Dec  8 15:59:33 1994
--- nfs_vfsops.c	Sun Jan  1 09:50:29 1995
***************
*** 290,295 ****
--- 290,301 ----
  				swdevt[i].sw_nblks/2);
  		} else
  			printf("using %d kbyte.\n",swdevt[i].sw_nblks/2);
+ 	} else {
+ 	  /*
+ 	   * No NFS swap space was specified, try using local disk
+ 	   */
+ 	  if (bdevvp(swapdev, &swapdev_vp))
+ 	    panic("nfs_mountroot: can't setup bdevvp for swap");
  	}
  
  	/*
>Release-Note:
>Audit-Trail:
>Unformatted:



