Commit Graph

7727 Commits

Author SHA1 Message Date
Alan Somers
067cbec26a MFC r319337:
Fix integer overflow in "camcontrol format"

Reported by:	Coverity
CID:		1011426
Sponsored by:	Spectra Logic Corp
2017-07-07 15:22:29 +00:00
Kirk McKusick
8ef57fa6f3 MFC of 320176:
Allow '_' in labels when specifying -L to newfs.

PR: 220163
Reported by: Keve Nagy
Reviewed by: kib
2017-06-26 17:33:33 +00:00
Enji Cooper
d4b943f26c MFC r316742:
Clarify units for mediasize and sectorsize in DoFile(..)

They're byte quantities.
2017-05-31 08:43:45 +00:00
Enji Cooper
9a83895417 MFC r316740:
Clarify `minfree` warning message in check_space(..)

- State that the units are kB.
- Be more complete/concise in terms of what is required (in this case
  `minfree` must be at least `X`kB)
2017-05-31 08:42:44 +00:00
Alan Somers
c698752873 MFC r317759:
Fix memory leaks in camcontrol

Reported by:	Coverity
CID:		1331674, 1331675
Reviewed by:	ken
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D10588
2017-05-30 22:46:00 +00:00
Alan Somers
126bfd62c4 MFC r317755, r317758
r317755:
Various Coverity fixes in ifconfig(8)

* Exit early if kldload(2) fails (1011259). This is the only change that
  affects ifconfig's behavior.
* Close memory and resource leaks (1305624, 1305205, 1007100)
* Mark usage() as _Noreturn (1305806, 1305750)
* Fix some dereference after null checks (1011474, 270774)

Reported by:	Coverity
CID:		1305624, 1305205, 1007100, 1305806, 1305750, 1011474,
CID:		270774, 1011259
Reviewed by:	cem
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D10587

r317758:
Unbreak ifconfig for mlx4en(4) after r317755

ifconfig doesn't correctly infer mlx interfaces' module names, so it will
attempt to load the mlx(4) module even when not necessary.

Reported by:	rstone
X-MFC-With:	317755
Sponsored by:	Spectra Logic Corp
2017-05-30 22:45:01 +00:00
Alan Somers
c326251498 MFC r317715:
ifconfig displays ND6_IFF_NO_DAD as "IGNORELOOP"

PR:		218958
Reviewed by:	kristof
Differential Revision:	https://reviews.freebsd.org/D10543
2017-05-30 22:44:05 +00:00
Alan Somers
20e7868288 MFC r316611:
sbin/mount: strcpy -> strlcpy

Reported by:	Coverity
CID:		1011173, 1011174
Sponsored by:	Spectra Logic Corp
2017-05-30 22:36:24 +00:00
Alan Somers
ef766a053c MFC r316535:
Fix memory leak in "gpart bootcode"

Also, annotate that gpart_issue never returns

Reported by:	Coverity
CID:		1007105
Sponsored by:	Spectra Logic Corp
2017-05-30 22:33:24 +00:00
Rick Macklem
264c423638 MFC: r317931
Fix mount_nfs so that it doesn't create mounttab entries for NFSv4 mounts.

The NFSv4 protocol doesn't use the Mount protocol, so it doesn't make sense
to add an entry for an NFSv4 mount to /var/db/mounttab. Also, r308871
modified umount so that it doesn't remove any entry created by mount_nfs.
2017-05-22 21:52:06 +00:00
Enji Cooper
58c82f22fa MFC r315775:
Add a post-humous manpage for cd9660(5), the ISO-9660 file system

Describe (briefly) how to compile the filesystem into the kernel and
load as a module.

Reference cd9660(5) in mount(8) and mount_cd9660(8).
2017-05-22 06:20:58 +00:00
Ravi Pokala
c7f17f47e7 MFC r318160, 318176: Persistently store NIC's hardware MAC address, and add
a way to retrive it

NOTE: Due to restructuring, the merges didn't apply cleanly; the resulting
change is almost identical to what went into stable/11, but in some cases in
different locations.

The MAC address reported by `ifconfig ${nic} ether' does not always match
the address in the hardware, as reported by the driver during attach. In
particular, NICs which are components of a lagg(4) interface all report the
same MAC.

When attaching, the NIC driver passes the MAC address it read from the
hardware as an argument to ether_ifattach(). Keep a second copy of it, and
create ioctl(SIOCGHWADDR) to return it. Teach `ifconfig' to report it along
with the active MAC address.

PR:		194386
2017-05-17 22:29:25 +00:00
Marius Strobl
67224c3ad3 MFC: r317343
In fill_ip6(), the value of the pointer av changes before it is
free(3)ed. Thus, introduce a new variable to track the original
value.
2017-05-14 13:59:40 +00:00
Kenneth D. Merry
3e87990d41 MFC r317854:
When editing a mode page on a tape drive, do not clear the device
  specific parameter.

  Tape drives include write protect (WP), Buffered Mode and Speed
  settings in the device-specific parameter.  Clearing this
  parameter on a mode select can have the effect of turning off
  write protect or buffered mode, or changing the speed setting of
  the tape drive.

  Disks report DPO/FUA support via the device specific parameter
  for MODE SENSE, but the bit is reserved for MODE SELECT.  So we
  clear this for disks (and other non-tape devices) to avoid
  potential errors from the target device.

  sbin/camcontrol/modeedit.c:
  	Clear the device-specific parameter in the mode page
  	header if we're not operating on a tape drive.

Sponsored by:	Spectra Logic
2017-05-08 18:30:56 +00:00
Kenneth D. Merry
8fa82ed325 MFC r317774, r317776
r317774:
  Add the ability to rescan or reset devices specified by peripheral
  name and unit number in camcontrol(8).

  Previously camcontrol(8) only supported rescanning or resetting
  devices specified by bus:target:lun.  This is because for
  rescanning at least, you don't have a peripheral name and unit
  number (e.g. da4) for devices that don't exist yet.

  That is still the case after this change, but in other cases, when
  the device does exist in the CAM EDT (Existing Device Table), we
  do a careful lookup of the bus/target/lun if the user supplies a
  peripheral name and unit number to find the bus:target:lun and then
  issue the requested reset or rescan.

  The lookup is done without actually opening the device in question,
  since a rescan is often done to make a device go away after it has
  been pulled.  (This is especially true for busses/controllers, like
  parallel SCSI controllers, that don't automatically detect changes
  in topology.)  Opening a device that is no longer there to
  determine the bus/target/lun might result in error recovery actions
  when the user really just wanted to make the device go away.

  sbin/camcontrol/camcontrol.c:
  	In dorescan_or_reset(), if the use hasn't specified a
  	numeric argument, assume he has specified a device.  Lookup
  	the pass(4) instance for that device using the transport
  	layer CAMGETPASSTHRU ioctl.  If that is successful, we can
  	use the returned bus:target:lun to rescan or reset the
  	device.

  	Under the hood, resetting a device using XPT_RESET_DEV is
  	actually sent via the pass(4) device anyway.  But this
  	provides a way for the user to specify devices in a more
  	convenient way, and can work on device rescans when the
  	device is going away, assuming it still exists in the EDT.

  sbin/camcontrol/camcontrol.8:
  	Update the man page for the rescan and reset subcommands
  	to reflect that you can now use a device name and unit
  	number with them.

Sponsored by:	Spectra Logic

r317776:
  Bump the camcontrol(8) man page date.

Sponsored by:	Spectra Logic
2017-05-08 17:02:03 +00:00
Rick Macklem
cc8f75415d MFC: r316793
Document the "oneopenown" option added by r316792.

This is a content change.
2017-04-27 21:45:50 +00:00
Konstantin Belousov
cfacd61cad MFC r316852:
In fsck_ffs pass1, prevent the inosused variable from wrapping.

PR:	218592
2017-04-21 10:16:34 +00:00
Dimitry Andric
5223ae8683 MFC r314671 (by cem):
newfs_nandfs: Fix unaligned pointer warning

PR:		217532
Submitted by:	Trond Endrestol <Trond.Endrestol at ximalas.info>
2017-04-13 17:11:50 +00:00
Enji Cooper
6f0670eaa4 MFC r315774:
mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)
2017-03-30 05:17:23 +00:00
Sevan Janiyan
b748ab3196 MFC r306733
Add history section to fsck(8)

PR:		212472
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D8104
2017-03-30 02:38:38 +00:00
Sevan Janiyan
2befcf74e8 MFC r266586
If called without -T or -t, fsck attempts to detect the
file system type.  If this fails, fsck will fail with
"unknown file system type" message.

PR:		188214
2017-03-30 02:37:37 +00:00
Sevan Janiyan
e1cdc3f2c8 MFC r306616
setkey appeared in FreeBSD 4.0

PR:		212551
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D8105
2017-03-30 02:32:38 +00:00
Sevan Janiyan
1ba1449a97 MFC r306617
shutdown appeared as a standalone utility in 4.1BSD.
http://mail-index.netbsd.org/source-changes-d/2016/09/13/msg008686.html
http://mail-index.netbsd.org/source-changes-d/2016/09/14/msg008691.html
PR:		212552
Approved by:	bcr (mentor)
Obtained from:	NetBSD
Differential Revision:	https://reviews.freebsd.org/D8105
2017-03-30 02:28:49 +00:00
Alexander Motin
5ff83bc694 MFC r315711: Fix printing bits above first eight. 2017-03-29 14:58:15 +00:00
Dmitry Marakasov
606ddb9df1 MFC r315242: Fix late and noauto with geli swap
With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by:	jilles
Approved by:	jilles
Differential Revision:	D9835
2017-03-28 10:43:20 +00:00
Enji Cooper
102e2185b5 MFC r315690:
Delete trailing whitespace (no functional change)
2017-03-27 18:24:27 +00:00
Enji Cooper
09942e5715 MFC r315199,r315200,r315203:
r315199:

sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)

The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

CID:		1007114

r315200:

Fix -Wunused-but-set-warning with `ret`

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

Tested with:	clang, gcc 4.2.1, gcc 6.3.0

r315203:

sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)

This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

CID:		1007111-1007113
2017-03-20 03:06:41 +00:00
Enji Cooper
24a4d6f76b MFC r314924:
sbin/devfs: clarify usage

- Note existence of -m option.
- Note that -s applies to rule keyword, only, by adding usage text
  specifically for the `rule` and `ruleset` keywords.

Don't go into any further detail in usage(..) -- it's best that one
reads the manpage to get a better idea of how things work as there are
a number of different option-specific keywords and arguments, as well
as some rule grammar.
2017-03-16 01:59:43 +00:00
Dag-Erling Smørgrav
fb6bdbad51 MFH (r303289): update example section
PR:		211361
2017-03-12 13:42:40 +00:00
Dag-Erling Smørgrav
49ddecb513 MFH (r314554): fix date in previous commit
Also remove mention of SKEIN-512 since it is not available in 10.
2017-03-12 13:20:07 +00:00
Dag-Erling Smørgrav
c5ea5b2719 MFH (r314528): update to reflect the state of SHA-1 2017-03-12 13:15:26 +00:00
Alan Somers
2c9880ca13 MFC r311572, r311895, r311928, r311985, r312395, r312417
r311572:
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by:	Coverity
CID:		271624 275338
Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9074

r311895:
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by:	Valgrind
Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9067

r311928:
Fix build of usr.bin/tail with GCC

Submitted by:	pluknet
Reported by:	pluknet
MFC after:	27 days
X-MFC-with:	311895
Sponsored by:	Spectra Logic Corp

r311985:
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by:	Coverity
CID:		979679 979680
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r312395:
Fix several Coverity CIDs in devd

CID 1362055, 1362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior
	if two devd instances start at the same time.
CID 1362015:	Unchecked error that will probably never fail

Reported by:	Coverity
CID:	1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r312417:
Fix build of devd with GCC 4.2

Reported by:	olivier
Pointy-hat-to:	asomers
MFC after:	27 days
X-MFC-with:	312395
Sponsored by:	Spectra Logic Corp
2017-02-28 22:18:05 +00:00
Andriy Gapon
5bcc6e632c MFC r300903: Implement SHA-512 truncated (224 and 256 bits) 2017-02-27 10:40:39 +00:00
Andriy Gapon
c4c6028dfe MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
cperciva's libmd implementation is 5-30% faster
The same was done for SHA256 previously in r263218

Approved by:	secteam
2017-02-27 08:27:38 +00:00
Kenneth D. Merry
37f1ae442c MFC r313893
------------------------------------------------------------------------
  r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines

  Add task attribute support to camcontrol(8).

  Users can use the new generic argument, -Q task_attr, to specify a task
  attribute (simple, ordered, head of queue, aca) for the commands issued.
  The the default is simple, which works with all SCSI devices that support
  tagged queueing.

  This will mostly be useful for debugging target behavior in certain
  situations.

  You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
  sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
  LUNs:

  ctladm delay 0:0 -l done -t 10
  camcontrol tur da34 -v

  And at then before the 10 second timer is up, in another terminal:

  camcontrol inquiry da34 -Q ordered -v

  The Inquiry should complete just after the TUR completes.  Ordinarily
  it would complete first because of the delay injection, but because the
  task attribute is set to ordered in this case, CTL holds it up until the
  previous command has completed.

  sbin/camcontrol/camcontrol.c:
  	Add the new generic argument, -Q, which allows the user to specify
  	a SCSI task attribute.  The user can specify task attributes by
  	name or numerically.

  	Add a new task_attr arguments to SCSI sub-functions.

  sbin/camcontrol/attrib.c,
  sbin/camcontrol/camcontrol.h,
  sbin/camcontrol/fwdownload.c,
  sbin/camcontrol/modeedit.c,
  sbin/camcontrol/persist.c,
  sbin/camcontrol/timestamp.c,
  sbin/camcontrol/zone.c:
  	Add the new task_attr argument to SCSI sub-functions.

  sbin/camcontrol/camcontrol.8:
  	Document the new -Q option, and add an example.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
2017-02-24 20:51:39 +00:00
Enji Cooper
c8fa43de1f MFC r313273:
style(9) cleanup

- Delete trailing whitespace
- Fix alignment/variable sorting
- Delete single-line enclosing braces
2017-02-12 09:27:34 +00:00
Enji Cooper
c06eac9206 MFC r289172,r290254:
r289172:

Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

r290254:

Remove unused variable (SRCDIR)
2017-02-09 22:49:48 +00:00
Alan Somers
51b99195df MFC r311160, r311210, r311288, r311292, r311298, r311340
r311160:
misc minor fixes in mpr(4)

sys/dev/mpr/mpr_sas.c
	* Fix a potential null pointer dereference (CID 1305731)
	* Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID
	  1211934)

sys/dev/mpr/mpr_sas_lsi.c
	* Nullify a dangling pointer in mprsas_get_sata_identify
	* Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935)

Reported by:	Coverity (partially)
CID:		1305731 1211934 1211935
Reviewed by:	slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8880

r311210:
Quell Coverity for diskinfo(8)

* CID 1198994: Don't run the speed disk on a disk with no sectors
* CID 1011442: Don't call close(2) if open(2) fails
* CID 1011161: Use snprintf instead of sprintf
* CID 1009825: Check the return value of lseek

Reported by:	Coverity
CID:		1198994 1011442 1011161 1009825
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r311288:
Delete dead code in chat(8)

It's always been dead, ever since first import in 1994.  It's still dead in
OpenBSD's version, too.

Reported by:	Coverity
CID:		270586
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r311292:
Remove dead code in rpc_parse.c

It's been dead ever since it was imported from TI-RPC in 1995.  The dead
code is still present in Illumos today, but was removed from NetBSD in 2006.

Reported by:	Coverity
CID:		270097
Obtained from:	NetBSD
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r311298:
Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805.  OpenBSD later deleted that entire function.

Reported by:	Coverity
CID:		500059
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r311340:
Misc Coverity fixes for tail(1)

CID 1006402:	Initialize stack variable
CID 271580:	Don't leak memory when ENOMEM.

Reported by:	Coverity
CID:		271580 1006402
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
2017-02-02 19:50:28 +00:00
Alexander Motin
dd92409fb9 MFC r312228: Make camcontrol cmd ... -i ... return only valid bytes.
Previously code ignored resid field and returned extra zeroes in case of
data underflow.  Now it returns only real bytes received from target.
2017-01-29 14:29:02 +00:00
Alexander Motin
624dc54e11 MFC r311897: Add checks for received mode page length.
If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by:    Coverity
CID:            1368374, 1368375
2017-01-21 08:19:42 +00:00
Alexander Motin
8e800aacf3 MFC r311636: Make 'camcontrol modepage' support subpages. 2017-01-21 08:17:30 +00:00
Alexander Motin
b13ec7ed91 MFC r311623: Make do_buff_decode() not read past the end of the buffer.
Abort format processing as soon as we have no enough data.
2017-01-21 08:15:51 +00:00
Brooks Davis
e94e74b613 MFC r310092:
Add a free_iovec() function to reset iovec's.

The primary purpose is to call nmount() in a loop with new iovec's so
free_iovec takes arguments by reference and resets their values.

Reviewed by:	cem
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D8513
2016-12-21 23:16:58 +00:00
Eric van Gyzen
124f59d7b7 MFC r309625
This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
to apply a two-clause BSD license, just so the license was clear.

This source tree location matches NetBSD, and is the first place someone
might look for such a tool.

Obtained from:	Joerg Sonnenberger via NetBSD
Sponsored by:	Dell EMC
2016-12-13 23:13:03 +00:00
Kenneth D. Merry
41425c5ca5 MFC r307684, r307747
------------------------------------------------------------------------
  r307684 | ken | 2016-10-20 13:42:26 -0600 (Thu, 20 Oct 2016) | 13 lines

  For CCBs allocated on the stack, we need to clear the entire CCB, not just
  the header.  Otherwise stack garbage can lead to random flags getting set.

  This showed up as 'camcontrol rescan all' failing with EINVAL because the
  address type wasn't CAM_DATA_VADDR.

  sbin/camcontrol/camcontrol.c:
  	In rescan_or_reset_bus(), bzero the stack-allocated CCBs before
  	use instead of clearing the body.

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
  r307747 | ken | 2016-10-21 12:54:56 -0600 (Fri, 21 Oct 2016) | 27 lines

  Fix a problem in camcontrol(8) that cropped up with r307684.

  In r307684, I changed rescan_or_reset_bus() to bzero stack-allocated CCBs
  before sending them to the kernel because there was stack garbage in there
  that wound up meaning that bogus CCB flags were set.

  While this fixed the 'camcontrol rescan all' case (XPT_DEV_MATCH CCBs were
  failing previously), it broke the 'camcontrol rescan 0' (or any other
  number) case when INVARIANTS are turned on.  Rescanning a single bus
  reliably produced an assert in cam_periph_runccb():

  panic: cam_periph_runccb: ccb=0xfffff80044ffe000, func_code=0x708, flags=0xffffdde0

  The flags values don't make sense from the code.  Changing the CCBs in
  rescan_or_reset_bus() from stack to heap allocated avoids the problem.

  It would be better to understand why userland stack allocated CCBs don't
  work properly, since there may be other code that breaks if stack allocated
  CCBs don't work.

  sbin/camcontrol/camcontrol.c:
  	In rescan_or_reset_bus(), allocate the CCBs using malloc(3) instead
  	of on the stack to avoid an assertion in cam_periph_runccb().

  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
2016-12-12 21:54:49 +00:00
Rick Macklem
5ffc76aa30 MFC: r308871
Modify umount so that it does not do an Unmount RPC for NFSv4 mounts
and uses TCP for the Unmount RPC if the mount is over TCP.
Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.
2016-12-03 21:56:46 +00:00
Brooks Davis
19b3feb13c MFC r309027:
Allocate a struct ifreq rather than using a (wrong) computed size for
the BIOCSETIF ioctl.

The kernel always copies an entire struct ifreq and IPv4 addresses will
always fit in an ifreq.

On systems with pointers larger than 64-bits, the computed size will be
less than the size of struct ifreq, potentially resulting in the kernel
attempting to copyin memory from outside the allocation.

Reviewed by:	jhb
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D8445
2016-11-30 01:22:12 +00:00
Andriy Gapon
bce42981d9 MFC r308089: zfsbootcfg: a simple tool to set next boot (one time)
options for zfsboot

There is a branch-specific change in sbin/zfsbootcfg/Makefile because of
LIBADD vs LDADD/DPADD.
2016-11-21 10:14:36 +00:00
Jilles Tjoelker
aca7f02e2b MFC r307755: swapoff: Remove only late devices with -aL.
Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be
very slow and may not even be possible if there is a lot of swap space in
use. However, removing swap devices is only needed for late swap devices
that may depend on daemons that subsequent shutdown steps stop. Normal swap
devices such as hard disk partitions will remain available throughout the
shutdown process and need not be removed.

In swapoff, interpret -aL to remove late swap devices only, and use this in
etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all
swap devices, both normal and late).

PR:		187081
2016-11-20 13:44:27 +00:00
Jilles Tjoelker
73a4b05224 MFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late
option in fstab.
2016-11-19 20:03:59 +00:00