Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 1996 11:36:12 +1000 (EST)
From:      David Leonard <d@scry.dstc.edu.au>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        leonard@dstc.edu.au
Subject:   bin/1542: swapon -a ignores 'noauto' tags in /etc/fstab
Message-ID:  <199608260136.LAA00617@scry.dstc.edu.au>
Resent-Message-ID: <199608260140.SAA06656@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1542
>Category:       bin
>Synopsis:       swapon -a ignores 'noauto' tags in /etc/fstab
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 25 18:40:01 PDT 1996
>Last-Modified:
>Originator:     David Leonard
>Organization:
DSTC, Brisbane, Australia  +61 7 3365 4310
>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

FreeBSD scry.dstc.edu.au 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Fri Aug 16 13:25:02 EST 1996     d@scry.dstc.edu.au:/u1/src/sys/compile/SCRY  i386

>Description:

	swapon -a ignores the 'noauto' tag in /etc/fstab. This 
	(I feel) is inconsistent with the -a option to mount. Since
	they both read from the same file (/etc/fstab) I would have
	thought they both honoured the noauto `option'!

>How-To-Repeat:

In /etc/fstab:

   /dev/wd0s2b			none		swap	sw		0 0
   /dev/wd1b			none		swap	sw,noauto	0 0

reboot, and

   Device      512-blocks     Used    Avail Capacity  Type
   /dev/wd0s2b      65536       64    65344     0%    Interleaved
   /dev/wd1b       131072        0   130944     0%    Interleaved
   Total           196352       64   196288     0%

>Fix:

untested diffs follow:

cvs server: Diffing .
Index: swapon.8
===================================================================
RCS file: /home/leonard/cvsroot/freebsd/src/sbin/swapon/swapon.8,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 swapon.8
*** swapon.8	1996/08/16 00:12:14	1.1.1.1
--- swapon.8	1996/08/26 01:29:27
***************
*** 61,67 ****
  All devices marked as ``sw''
  swap devices in
  .Pa /etc/fstab
! are made available.
  .El
  .Pp
  The second form gives individual block devices as given
--- 61,67 ----
  All devices marked as ``sw''
  swap devices in
  .Pa /etc/fstab
! are made available, unless marked with ``noauto''.
  .El
  .Pp
  The second form gives individual block devices as given
Index: swapon.c
===================================================================
RCS file: /home/leonard/cvsroot/freebsd/src/sbin/swapon/swapon.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 swapon.c
*** swapon.c	1996/08/16 00:12:14	1.1.1.1
--- swapon.c	1996/08/26 01:29:27
***************
*** 76,81 ****
--- 76,83 ----
  		while ((fsp = getfsent()) != NULL) {
  			if (strcmp(fsp->fs_type, FSTAB_SW))
  				continue;
+ 			if (strstr(fsp->fs_mntops, "noauto"))
+ 				continue;
  			if (add(fsp->fs_spec, 1))
  				stat = 1;
  			else
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608260136.LAA00617>