History log of /freebsd-10.1-release/sbin/swapon/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
273188 16-Oct-2014 hrs

MFS r272855, 266846:

- Do not override sin6_scope_id in LLA when it is already set to non-zero.
This fixes destination list in output of netstat -r.
- Plug a memory leak.
- Add RTM_VERSION check.
- Fix a bug which can make sysctl() fail when -F is specified.
- Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because
we have interfaces with longer names than 6 chars like epairN{a,b}.
- Style fixes.

MFS r272847:

- Add rwlock to struct dadq. A panic could occur when a large number of
addresses performed DAD at the same time.

MFS r272850:

- Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.

- Replace Sun Industry Standards Source License for Sun RPC code with a
3-clause BSD license as specified by Oracle America, Inc. in 2010.
This license change was approved by Wim Coekaerts, Senior Vice
President, Linux and Virtualization at Oracle Corporation.

- Replace Sun RPC license with a 3-clause BSD license. This license change
was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and
Virtualization at Oracle Corporation.

- Replace Sun RPC license for TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.
The code in question in this file was copied from
lib/libc/rpc/pmap_getport.c.

MFS r272852,r272853:

- Add relative specification in expiration time.
- Add proto3 option for RTF_PROTO3.
- Use %lu for members of struct rt_metrics.
- Use long explicitly for the time difference.

MFS r272854:

- Return 0 if:

1. "-u N" specified, no -f, and mdN found,
2. no -u, "-f /pathname" specified, and mdN associated with
/pathname found,
3. "-u N" specified, "-f /pathname" specified, and both of them found,
4. "-l" specified and no -f,
5. "-l" specified, "-f /pathname" specified, and /pathname found.

otherwise return -1.

MFS r272856:

- Move configuration of IPv6 NDP flags to a point before handling ifconfig_IF.
This fixes a race that a non-IPv4 interface can get an EUI64 LLA even if it
has IFDISABLED nd6 flag at boot time.

MFS r272857:

- Cancel DAD for an ifa when the ifp has ND6_IFF_IFDISABLED as early as
possible and do not clear IN6_IFF_TENTATIVE. If IFDISABLED was accidentally
set after a DAD started, TENTATIVE could be cleared because no NA was
received due to IFDISABLED, and as a result it could prevent DAD when
manually clearing IFDISABLED after that.

MFS r272858:

- Fix an issue in range specification handling when a "-foo" is specified in
ifconfig_IF_aliasN.

MFS r272859:

- Fix EtherIP. TOS field must be initialized when the inner protocol is
PF_LINK, and multicast/broadcast flag should always be dropped because
the outer protocol uses unicast even when the inner address is not for
unicast. It had been broken since r236951 when gif_output() started to
use IFQ_HANDOFF().

MFS r272860:

- Recover sin6_scope_id of gateway addresses in riprecv() by using the
if_index where a RIP packet was received. This fixes a bug which
prevented gateway addresses in fe80::/64 from being added.

MFS r272861:

- Fix rc.d/gssd script to define the default values in a standard way.
- Use a parameter argument in jls(8) instead of doing grep.

MFS r272862, r272870:

- Restructure rc.d scripts for kerberos5 daemons.

MFS r272863:

- Return false status only when adding a route is failed. It could
erroneously return false due to an afexists() check loop in routing_start().

MFS r272864:

- Use ipv6_prefer when at least one ifconfig_IF_ipv6 is configured.

MFS r272865:

- Fix a bug which prevented mount.fstab parameter from being converted
when jail_JID_devfs_enable=NO.

MFS r272866:

- Fix header output when -P is specified and (ncpus - 1) != maxid.

MFS r272867:

- Fix a bug which could break extended attributes in a dump output.
This occurred when a file was >892kB long and had a large data (>1kB)
in the extended attributes.

MFS r272868, r272869:

- Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and
net.inet.ip.process_options vnet-aware.

MFS r272871:

- Revert changes in r269180. It could cause -c N option to enter an
infinite loop if no reply packet is received.

MFS r272874:

- Resurrect set_rcvar() as a function to define a rc.conf variable.
It defines a variable and its default value in load_rc_config() just after
rc.conf is loaded. "rcvar" command shows the current and the default
values.

MFS r272960:

- Do not add late flag when file= is specified because it has a bad
side-effect. The specified file should exist before the fstab line.

Approved by: re (gjb)


/freebsd-10.1-release/etc/defaults/rc.conf
/freebsd-10.1-release/etc/network.subr
/freebsd-10.1-release/etc/rc.d/Makefile
/freebsd-10.1-release/etc/rc.d/SERVERS
/freebsd-10.1-release/etc/rc.d/gssd
/freebsd-10.1-release/etc/rc.d/ip6addrctl
/freebsd-10.1-release/etc/rc.d/ipropd_master
/freebsd-10.1-release/etc/rc.d/ipropd_slave
/freebsd-10.1-release/etc/rc.d/jail
/freebsd-10.1-release/etc/rc.d/kadmind
/freebsd-10.1-release/etc/rc.d/kdc
/freebsd-10.1-release/etc/rc.d/kerberos
/freebsd-10.1-release/etc/rc.d/kfd
/freebsd-10.1-release/etc/rc.d/kpasswdd
/freebsd-10.1-release/etc/rc.d/routing
/freebsd-10.1-release/etc/rc.subr
/freebsd-10.1-release/include/rpcsvc/bootparam_prot.x
/freebsd-10.1-release/include/rpcsvc/key_prot.x
/freebsd-10.1-release/include/rpcsvc/klm_prot.x
/freebsd-10.1-release/include/rpcsvc/mount.x
/freebsd-10.1-release/include/rpcsvc/nfs_prot.x
/freebsd-10.1-release/include/rpcsvc/nis.x
/freebsd-10.1-release/include/rpcsvc/nis_callback.x
/freebsd-10.1-release/include/rpcsvc/nis_object.x
/freebsd-10.1-release/include/rpcsvc/nis_tags.h
/freebsd-10.1-release/include/rpcsvc/rex.x
/freebsd-10.1-release/include/rpcsvc/rnusers.x
/freebsd-10.1-release/include/rpcsvc/rstat.x
/freebsd-10.1-release/include/rpcsvc/sm_inter.x
/freebsd-10.1-release/include/rpcsvc/spray.x
/freebsd-10.1-release/include/rpcsvc/yp.x
/freebsd-10.1-release/include/rpcsvc/yppasswd.x
/freebsd-10.1-release/lib/libc/rpc/LICENSE
/freebsd-10.1-release/lib/libc/xdr/xdr.c
/freebsd-10.1-release/lib/libc/xdr/xdr_array.c
/freebsd-10.1-release/lib/libc/xdr/xdr_float.c
/freebsd-10.1-release/lib/libc/xdr/xdr_mem.c
/freebsd-10.1-release/lib/libc/xdr/xdr_rec.c
/freebsd-10.1-release/lib/libc/xdr/xdr_reference.c
/freebsd-10.1-release/lib/libc/xdr/xdr_sizeof.c
/freebsd-10.1-release/lib/libc/xdr/xdr_stdio.c
/freebsd-10.1-release/sbin/dump/traverse.c
/freebsd-10.1-release/sbin/mdconfig/mdconfig.c
/freebsd-10.1-release/sbin/ping6/ping6.c
/freebsd-10.1-release/sbin/route/keywords
/freebsd-10.1-release/sbin/route/route.8
/freebsd-10.1-release/sbin/route/route.c
swapon.c
/freebsd-10.1-release/sys/netinet/in_gif.c
/freebsd-10.1-release/sys/netinet/ip_fastfwd.c
/freebsd-10.1-release/sys/netinet/ip_options.c
/freebsd-10.1-release/sys/netinet/ip_options.h
/freebsd-10.1-release/sys/netinet6/in6_gif.c
/freebsd-10.1-release/sys/netinet6/nd6_nbr.c
/freebsd-10.1-release/usr.bin/netstat/route.c
/freebsd-10.1-release/usr.bin/vmstat/vmstat.c
/freebsd-10.1-release/usr.sbin/route6d/route6d.c
/freebsd-10.1-release/usr.sbin/ypbind/yp_ping.c
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


259871 25-Dec-2013 pluknet

MFC r258469:

- Purge one more reference to ad(4)[1].
- NSWAPDEV limit has gone.

Noticed by: Sergey V. Dyatko [1]


259820 24-Dec-2013 jilles

MFC r259677: swapon: Fix buffer overflow when configuring swap on GBDE.

PR: bin/184950


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255267 05-Sep-2013 hrs

Style clean-ups.

Reviewed by: md5


255265 05-Sep-2013 hrs

Enable "late" option when a file= option is specified in /etc/fstab.
The file= option requires rw mount where the backing store exists but
it does not work because rc.d/swap runs before rc.d/fsck.
Reported by: wblock


253834 31-Jul-2013 delphij

Make two buffer variables static for now. It is not safe to
reference stack memory after return.

MFC after: 2 weeks


252514 02-Jul-2013 delphij

Plug a memory leak.


252480 01-Jul-2013 delphij

Correct a typo in comment.


252388 29-Jun-2013 delphij

- Modify swapon(8) so that it uses most of geli(8) defaults for swap,
which is presently: AES-XTS, no authentication. Create provider
with pagesize as sectorsize by default.
- Rewrite parsing code for geli(8)-backed swap options, now options
are required to be exact match, and unrecognized options will trigger
a warning.
- Don't initialize GELI device if it's already initialized. This
restores previous behavior.
- Don't duplicate file descriptor when working with geli(8) and
gbde(8) as there is no need to communicate with the utility other
than exit status.
- When calling swap_on_off_* routines, which_prog can only be SWAP_ON
or SWAP_OFF. Eliminate unneeded case branches by replacing switch
with if's.
- Plug a few memory leaks.

Reviewed by: hrs (but bugs are mine)
MFC after: 1 week
X-MFC-with: r252310, r252332, r252345


252345 28-Jun-2013 hrs

Fix build with gcc.


252332 28-Jun-2013 hrs

Fix build.

Spotted by: gjb


252310 27-Jun-2013 hrs

- Add vnode-backed swap space specification support. This is enabled when
device names "md" or "md[0-9]*" and a "file" option are specified in
/etc/fstab like this:

md none swap sw,file=/swap.bin 0 0

- Add GBDE/GELI encrypted swap space specification support, which
rc.d/encswap supported. The /etc/fstab lines are like the following:

/dev/ada1p1.bde none swap sw 0 0
/dev/ada1p2.eli none swap sw 0 0

.eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.

swapctl(8) can understand an encrypted device in the command line
like this:

# swapctl -a /dev/ada2p1.bde

- "-L" flag is added to support "late" option to defer swapon until
rc.d/mountlate runs.

- rc.d script change:

rc.d/encswap -> removed
rc.d/addswap -> just display a warning message if $swapfile is defined
rc.d/swap1 -> renamed to rc.d/swap
rc.d/swaplate -> newly added to support "late" option

These changes alleviate a race condition between device creation/removal
and swapon/swapoff.

MFC after: 1 week
Reviewed by: wblock (manual page)


227081 04-Nov-2011 ed

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


226742 25-Oct-2011 ed

Build swapon with WARNS=6.

Don't use a variable called stat, because it collides with stat(2).


226712 25-Oct-2011 sobomax

Add new option -F to specify alternative location of the /etc/fstab
file.

MFC after: 1 month


202532 17-Jan-2010 ed

Raise WARNS for various tools where possible.

Submitted by: Marius Nünnerich <marius@nuenneri.ch>


198236 19-Oct-2009 ru

Switch the default WARNS level for sbin/ to 6.

Submitted by: Ulrich Spörlein


179966 23-Jun-2008 mtm

Add a -q flag to swapon(8) to suppress informational messages. Use it in
rc.d.
Note: errors are not affected by this flag.


179154 20-May-2008 pjd

- Change the meaning of -h flag from giving the output in megabytes to
giving the output in a human-readable form. This behaviour is consistent
with most of system tools.
- Add -m and -g options to give output in megabytes and gigabytes
respectively.


141611 10-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


140415 18-Jan-2005 ru

Sort sections.


138129 27-Nov-2004 das

Don't include sys/user.h merely for its side-effect of recursively
including other headers.


128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


126643 05-Mar-2004 markm

Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64


114589 03-May-2003 obrien

Use __FBSDID() to quiet GCC 3.3 warnings.


111654 28-Feb-2003 keramida

Spell "utilities" correctly.


111470 25-Feb-2003 ru

More fixes.

Submitted by: Andy Farkas <andyf@speednet.com.au>
Reviewed by: das


111453 24-Feb-2003 ru

mdoc(7) police: Tidy up.


111425 24-Feb-2003 das

Clarify about NSWAPDEV, add a DIAGNOSTICS section pointing to
swapon(2), and correct HISTORY.

Reviewed by: mike (mentor)


111424 24-Feb-2003 das

- Add a clearer error message for the case where swapon hits the
NSWAPDEV limit.
- Don't warn about devices that are not in use in 'swapoff -a'.
- Re-add behavior mistakenly removed in revision 1.44:
If using 'swapon -a', do not warn if the device is already in use.

PR: 46633
Submitted by: Andy Farkas <andyf@speednet.com.au> (in part)
Reviewed by: mike (mentor)


108459 30-Dec-2002 mike

Remove hack from rev 1.15; getbsize(3)'s original interface has been
restored.


108425 30-Dec-2002 mike

Make the first argument to getbsize(3) a `size_t *'. This is a hack
since getbsize(3) should have `int *' as its first parameter.


108375 28-Dec-2002 dillon

Add 'swapctl' - as a hardlink to swapon/swapoff, and augment swapon with
swapctl functionality. The idea is to create a swapctl command that is
fairly close to the OpenBSD and NetBSD version. FreeBSD does not implement
swap priority (and it would be a mistake if we did) so we didn't bother with
that part of it.

Submitted by: Eirik Nygaard <eirikn@bluezone.no>
Augmented by: dillon (extensively)
Reviewed by: David Schultz <dschultz@uclink.Berkeley.EDU>


107913 15-Dec-2002 dillon

This is David Schultz's swapoff code which I am finally able to commit.
This should be considered highly experimental for the moment.

Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU>
MFC after: 3 weeks


102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


99503 06-Jul-2002 charnier

The .Nm utility.


92883 21-Mar-2002 imp

o remove __P
o remove main prototype


92806 20-Mar-2002 obrien

Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
"register" -- just how many free registers do people think machines have?)


87325 04-Dec-2001 obrien

Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by: mike


79758 15-Jul-2001 dd

Set WARNS=2 on programs which compile cleanly.

Submitted by: Mike Barcroft <mike@q9media.com>


79530 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


78732 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


75385 10-Apr-2001 ru

vnconfig(8) -> mdconfig(8).


74815 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


74531 20-Mar-2001 ru

Set the default manual section for sbin/ to 8.


68960 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


59216 14-Apr-2000 imp

Add include of errno.h where needed, remove extern int errno where not.

These commits were inspired by a similar commit to netbsd.


57578 28-Feb-2000 gsutter

correct wording in BUGS section; it's not possible to dismount swap
devices, but it's certainly possible to make use of them.

PR: 17013
Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>


51669 26-Sep-1999 nik

Mention /dev/vn0b and /dev/vntab. ascii -> ASCII transform had
already happened in an earlier commit.

PR: docs/13645
Submitted by: Stephen Roznowski <sjr@home.com>


51457 20-Sep-1999 phantom

Correct spelling : ascii -> ASCII

PR: docs/13702
Submitted by: Stephen J. Roznowski <sjr@home.com>
Reviewed by: mpp


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


47260 17-May-1999 jkoshy

Refer to current names for swap partitions in the `FILES' section.

PR: docs/11709
Submitted by: Matthew D. Fuller <fullermd@over-yonder.net>


38039 03-Aug-1998 charnier

.Nm swapon -> .Nm.
Sort #includes. Add rcsid.


32967 01-Feb-1998 steve

Revert last commit and SEE ALSO pstat(8) instead.

Submitted by: Bruce Evans


32774 25-Jan-1998 steve

SEE ALSO swapinfo(8).

PR: 5447
Submitted by: Craig Leres <leres@ee.lbl.gov>


28771 26-Aug-1997 imp

.Xr vnconfig 8. This was suggested by Dworkin Muller <dworkin@village.org>
when he tried to figure out how to swap to a file and had to ask me for
help.


26740 19-Jun-1997 charnier

Use warn(3).


24359 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


22990 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


18480 23-Sep-1996 wosch

add missing comma(s) in .Xr macros


18073 06-Sep-1996 jkh

Make the noauto flag usable for swap devices too. Closes PR#1542
Submitted-By: David Leonard <d@scry.dstc.edu.au>


8502 14-May-1995 dg

Take out special error message for EINVAL...we really do want it to be
"invalid argument".


6661 23-Feb-1995 phk

Fix -Wall warnings.

Yes I have better things to do, but just now I'm waiting...


6513 17-Feb-1995 jkh

fstab is in section 5, not section 8.
Obtained from: NetBSD


1855 05-Aug-1994 wollman

Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.


1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.