Commit Graph

7443 Commits

Author SHA1 Message Date
melifaro
0576e44091 Merge r260524,r260540
r260524:
  Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8).

r260540:
  Bump dates in nestat(1) and route(8) man pages.
  Fix several small errors introduced by r260524.

  Suggested by: glebius
2014-05-08 19:35:12 +00:00
melifaro
89bf7e80ea Merge r258708, r258711, r260247, r261117.
r258708:
Check ipfw table numbers in both user and kernel space before rule addition.
Found by:       Saychik Pavel <umka@localka.net>

r258711:
Simplify O_NAT opcode handling.

r260247:
Use rnh_matchaddr instead of rnh_lookup for longest-prefix match.
rnh_lookup is effectively the same as rnh_matchaddr if called with
empy network mask.

r261117:
Reorder struct ip_fw_chain:
* move rarely-used fields down
* move uh_lock to different cacheline
* remove some usused fields
2014-05-08 19:11:41 +00:00
melifaro
e9871feb64 Merge r258677.
Fix key lookup in ipfw(8) broken since r232865.
Print warning for IPv4 address strings which are valid in
inet_aton() but not valid in inet_pton(). (1)

Found by:       Özkan KIRIK <ozkan.kirik@gmail.com>
Submitted by:   Ian Smith <smithi@nimnet.asn.au> (1)
2014-05-08 18:09:32 +00:00
smh
d4010b5267 MFC r264863
Add information about supported NCQ functionality to camcontrol identify.

Sponsored by:	Multiplay
2014-05-08 08:18:48 +00:00
mav
246a5ae3a0 MFC r260509:
Replace several instances of -1 with appropriate CAM_*_WILDCARD and types.

It was equal before r259397, but for good or bad, not any more for LUNs.

This change fixes at least CAM debugging.
2014-05-08 06:55:48 +00:00
jimharris
9f6b11fff3 MFC r260381:
For "nvmecontrol devlist", show namespace sizes in terms of MB instead of
GB to improve granularity of the reporting - especially for namespaces
that are on the order of 1 or 2 GB.
2014-05-07 16:53:42 +00:00
jimharris
3f0fde84c4 MFC r258071:
Check for special status code from FIRMWARE_ACTIVATE command
signifying that a reboot is required to complete activation
of the requested firmware image.
2014-05-07 16:52:29 +00:00
marius
c1f0e5c458 MFC: r265248
Allow GEOM_VINUM to be statically compiled into the kernel.

Submitted by:	gleb
2014-05-07 09:55:47 +00:00
markj
ac8b74dc0a MFC r262775:
Log the name of the file that we failed to open rather than an
uninitialized buffer.
2014-04-29 03:49:40 +00:00
jmmv
1e4589b921 MFC various moves of tools/regressions/ tests to the new infrastructure.
- r263220 Migrate tools/regression/sbin/ to the new tests layout.
- r263222 Add Makefile missed in r263220.
- r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
- r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout.
- r263345 Expand tabs that sneaked in into spaces.
- r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout.
- r263348 Add Makefiles missed in r263346.
- r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout.
- r263388 Mark multi_test as requiring /usr/share/dict/words.
- r263814 Fix path to the run.pl script to let these tests run.
- r264742 Prevent building tests when bootstrapping make.

This is 'make tinderbox' clean.
2014-04-27 01:15:10 +00:00
brueffer
3483d57e80 MFC: r264489
Add a missing break in option parsing.

CID:		1011452
Found with:	Coverity Prevent(tm)
2014-04-23 09:22:24 +00:00
brueffer
53a0ec56bb MFC: r264479
Fix double fclose() in an error case.

CID:		1006120
Found with:	Coverity Prevent(tm)
2014-04-23 07:33:51 +00:00
dim
b4a5074609 MFC r263778:
Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially.  Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

		before    stddev       after    stddev
		=======   ======       =======  ======
real time        1741.1     16.5         959.8     2.7
user time       12468.7     16.4       14393.0    16.8
sys  time        1825.0     54.8        2110.6    22.8

(user+sys)/real     8.2                   17.1

E.g. the build was approximately 45% faster in real time.  On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive.  But at least you can now almost max out a machine with
buildworld!

Submitted by:	jilles

MFC r263833:

Enable parallel building for gnu/usr.bin and usr.bin/clang too.
2014-04-09 18:16:58 +00:00
ae
fa4bb91966 MFC r264039:
Document more parition types.
2014-04-09 13:35:39 +00:00
mjg
b357774f50 MFC r263758:
Update userspace users of hw.bus.devctl_disable.

This switches the code to use hw.bus.devctl_queue instead.
2014-03-31 02:53:15 +00:00
dim
16ced98065 MFC r263774:
Revert r263694, and apply a better fix to squelch unnecessary warnings
from clang about possible keywords being treated as identifiers for the
remainder of the translation unit (a.k.a. -Wkeyword-compat), when using
libstdc++ in combination with -Wsystem-headers.  This will not only fix
devd, but any C++ program using libstdc++.
2014-03-29 11:33:52 +00:00
asomers
340d7c934c MFC r262914
sbin/devd/devd.8
sbin/devd/devd.cc
	Add a -q flag to devd that will suppress syslog logging at
	LOG_NOTICE or below.
2014-03-28 16:27:48 +00:00
dim
6b112fdc4b MFC r263694:
Apply a temporary band-aid for building devd with clang 3.4, libstdc++
and -Wsystem-headers enabled (which is the default for any non-zero
WARNS level, crazily enough!).  This is primarily meant to be MFC'd as
soon as possible.
2014-03-27 20:46:46 +00:00
mckusick
ae02668034 MFC of 263062:
Avoid segment fault when attempting to clean up cylinder group
buffer cache.

PR:             187221
Submitted by:   Petr Lampa <lampa@fit.vutbr.cz>
Obtained from:  Petr Lampa <lampa@fit.vutbr.cz>
MFC after:      1 week

MFC of 262488:

Arguments for malloc and calloc should be size_t, not int.
Use proper bounds check when trying to free cached memory.

Spotted by: Xin Li
Tested by:  Dmitry Sivachenko
MFC after:  2 weeks
2014-03-22 11:43:35 +00:00
glebius
f937dcf2bd Bulk sync of pf changes from head, in attempt to fixup broken build I
made in r263029.

Merge r257186,257215,257349,259736,261797.

These changesets split pfvar.h into several smaller headers and make
userland utilities to include only some of them.
2014-03-12 10:45:58 +00:00
glebius
71d3a4f585 Merge r261882, r261898, r261937, r262760, r262799:
Once pf became not covered by a single mutex, many counters in it became
  race prone. Some just gather statistics, but some are later used in
  different calculations.

  A real problem was the race provoked underflow of the states_cur counter
  on a rule. Once it goes below zero, it wraps to UINT32_MAX. Later this
  value is used in pf_state_expires() and any state created by this rule
  is immediately expired.

  Thus, make fields states_cur, states_tot and src_nodes of struct
  pf_rule be counter(9)s.
2014-03-11 15:43:06 +00:00
des
0af7d6ff77 MFH (r256768): don't report an error for no-op add / remove 2014-02-27 13:08:43 +00:00
jhb
5b0bab6d24 MFC 261517,261520:
Convert the license on files where I am the sole copyright holder to
2 clause BSD licenses.
2014-02-18 20:27:17 +00:00
brueffer
7a5c4e8898 Refer newfs and growfs users to fsck_ffs instead of
fsck, the latter does not accept the referred to "-b" flag.

PR:		82720
Submitted by:	David D.W. Downey
2014-02-16 10:16:07 +00:00
brueffer
b27bfe4c09 MFC: r261566
Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT.

PR:		185382 (based on)
Submitted by:	Loganaden Velvindron
Reviewed by:	pjd
2014-02-13 09:24:46 +00:00
brueffer
222b98b9ae MFC: r261500
Add a license (1) and do some cleanup.

Approved by:	Stefan Bethke (original author, by private mail) (1)
2014-02-11 13:33:03 +00:00
brueffer
dfbfe377ea MFC: r261496
Unbreak mount_udf by passing the correct iovec length into
nmount().  This has been broken since r247861.

PR:		bin/186193
Submitted by:	Arnot Belohlavek
2014-02-11 08:20:45 +00:00
bapt
bc9afa8bed MFH: r260483, r260484, r260594, r260595, r260596, r260597
Improve error message shown to the user when trying to load a module that is
already loaded or compiled withing the kernel
Point the user to dmesg(1) to get informations about why loading a module did fail
instead of printing the cryptic "Exec format error"
Update the BUGS section of kld(4) according the recent changes in kldload(8)
2014-01-20 14:37:02 +00:00
asomers
6b686ee50a MFC 259339
sbin/devd/devd.cc
        Increase the size of devd's client socket's send buffer from the
        default (8k) to 128k.  This prevents clients from getting
        POLLHUPped during event storms.  For example, during zpool creation,
        the kernel emits a resource.fs.zfs.statechange event for every vdev
        in the pool.  A 128k buffer is large enough to hold the statechange
        events for a pool with nearly 800 drives.

MFC 259362
    sbin/devd/devd.cc
        Promoting the SIGINFO handler's log message from LOG_INFO to
        LOG_NOTICE, and promoting the "Processing event ..." message from
        LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
        change will have the same result as setting it to LOG_INFO without
        this change.  Setting it to LOG_INFO with this change will include
        the useful "Processing event ..." messages that were previously at
        LOG_DEBUG, without including useless messages like "Pushing table".

        The intent of this change is that one can log "Processing event ..."
        without logging "Pushing table" and related messages that are sent
        for every event.  The number of lines actually logged is reduced by
        about 75% by making this change and setting syslog to LOG_INFO vs
        setting syslog to LOG_DEBUG.

    etc/syslog.conf
        Changing the recommended loglevel to notice instead of info.
2014-01-10 17:56:23 +00:00
ae
2865f87f4a MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.

  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.

  Now "gmirror destroy" command is available. It destroys geom and also
  erases gmirror's metadata.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
  Now it is easy to expand the size of the mirror when all its components
  are replaced. Also add g_resize method to geom_mirror class. It will write
  updated metadata to new last sector, when parent provider is resized.
2014-01-10 07:43:40 +00:00
trasz
58ba35d28d MFC r258659:
Fix warnings to not append "No error: 0".

Sponsored by:	The FreeBSD Foundation
2014-01-02 13:48:54 +00:00
trasz
a4c13259b5 MFC r259502:
Reword the part about mutual CHAP.

Sponsored by:	The FreeBSD Foundation
2014-01-02 13:46:33 +00:00
scottl
cbabeda669 MFC r260068, r260069, r260076
Add the -R option to allow fsck_ffs to restart itself when too many critical
 errors have been detected in a particular run.

 Clean up the global state variables so that a restart can happen correctly.

 Separate the global variables in fsck_ffs and fsdb to their own file.  This
 fixes header sharing with fscd.

 Correctly initialize, static-ize, and remove global variables as needed in
 dir.c.  This fixes a problem with lost+found directories that was causing
 a segfault.

 Correctly initialize, static-ize, and remove global variables as needed in
 suj.c.

 Initialize the suj globals before allocating the disk object, not after.
 Also ensure that 'preen' mode doesn't conflict with 'restart' mode

Obtained from:	Netflix
2014-01-02 01:44:14 +00:00
scottl
1969ab94ba MFC r260059, r260087:
Add the '-b' flag to 'camcontrol devlist'.  This prints only the existing
buses and their parent sims, useful for creating a sim->bus->device map.

Obtained from:	Netflix
2014-01-02 01:40:19 +00:00
rmacklem
0594a08a57 MFC: r259089
Document the noncontigwr NFS mount option.
This is a content change.
2013-12-30 21:20:51 +00:00
trociny
cc424717c7 MFC r257155, r257582, r259191, r259192, r259193, r259194, r259195, r259196:
r257155:

Make hastctl list command output current queue sizes.

Reviewed by:	pjd

r257582 (pjd):

Correct alignment.

r259191:

For memsync replication, hio_countdown is used not only as an
indication when a request can be moved to done queue, but also for
detecting the current state of memsync request.

This approach has problems, e.g. leaking a request if memsynk ack from
the secondary failed, or racy usage of write_complete, which should be
called only once per write request, but for memsync can be entered by
local_send_thread and ggate_send_thread simultaneously.

So the following approach is implemented instead:

1) Use hio_countdown only for counting components we waiting to
   complete, i.e. initially it is always 2 for any replication mode.

2) To distinguish between "memsync ack" and "memsync fin" responses
   from the secondary, add and use hio_memsyncacked field.

3) write_complete() in component threads is called only before
   releasing hio_countdown (i.e. before the hio may be returned to the
   done queue).

4) Add and use hio_writecount refcounter to detect when
   write_complete() can be called in memsync case.

Reported by:	Pete French petefrench ingresso.co.uk
Tested by:	Pete French petefrench ingresso.co.uk

r259192:

Add some macros to make the code more readable (no functional chages).

r259193:

Fix compiler warnings.

r259194:

In remote_send_thread, if sending a request fails don't take the
request back from the receive queue -- it might already be processed
by remote_recv_thread, which lead to crashes like below:

  (primary) Unable to receive reply header: Connection reset by peer.
  (primary) Unable to send request (Connection reset by peer):
      WRITE(954662912, 131072).
  (primary) Disconnected from kopusha:7772.
  (primary) Increasing localcnt to 1.
  (primary) Assertion failed: (old > 0), function refcnt_release,
      file refcnt.h, line 62.

Taking the request back was not necessary (it would properly be
processed by the remote_recv_thread) and only complicated things.

r259195:

Send wakeup to threads waiting on empty queue before releasing the
lock to decrease spurious wakeups.

Submitted by:	davidxu

r259196:

Check remote protocol version only for the first connection (when it
is actually sent by the remote node).

Otherwise it generated confusing "Negotiated protocol version 1" debug
messages when processing the second connection.
2013-12-28 19:21:22 +00:00
pluknet
ddabe064bb MFC r258469:
- Purge one more reference to ad(4)[1].
- NSWAPDEV limit has gone.

Noticed by:	Sergey V. Dyatko [1]
2013-12-25 15:40:15 +00:00
jilles
20e995f743 MFC r259677: swapon: Fix buffer overflow when configuring swap on GBDE.
PR:		bin/184950
2013-12-24 13:46:54 +00:00
asomers
7779917bec MFC 257006
sbin/geom/class/part/geom_part.c
        Always validate the return of find_geomcfg().  It could be NULL, for
        example when the geom is withering.

Approved by:    ken (mentor)
Sponsored by:   Spectra Logic Corporation
2013-12-13 16:55:39 +00:00
pfg
de938e4059 MFC r256448, r257029;
Make di_blocks unsigned in UFS1 as is the case already for UFS2.
 Most of the code between UFS1 and UFS2 is shared so this change
 is pretty safe. Not only this makes UFS1 and 2 consistent but it
 also matches what NetBSD and MacOS X have for some years now.

UFS2: make di_extsize unsigned.
 di_extsize is the EA size and as such it should be unsigned.
 Adjust related types for consistency.

Reviewed by:	mckusick
2013-12-11 19:25:17 +00:00
nwhitehorn
ebd6e46afc MFC r257345,257382,257388:
Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
the upper 32-bits of the LUN, if possible, into the target_lun field as
passed directly from the REPORT LUNs response. This allows extended LUN
support to work for all LUNs with zeros in the lower 32-bits, which covers
most addressing modes without breaking KBI. Behavior for drivers not
setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.

Extended LUNs are stored with swizzled 16-bit word order so that, for
devices implementing LUN addressing (like SCSI-2), the numerical
representation of the LUN is identical with and without PIM_EXTLUNS. Thus
setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
is provided to transform a lun_id_t into a uint64_t ordered for the wire.

This is the second part of work for full 64-bit extended LUN support and is
designed to a bridge for stable/10 to the final 64-bit LUN code. The
third and final part will involve widening lun_id_t to 64 bits and will
not be MFCed. This third part will break the KBI but will keep the KPI
unchanged so that all drivers that will care about this can be updated now
and not require code changes between HEAD and stable/10.

Reviewed by:	scottl
2013-12-10 22:55:22 +00:00
jimharris
e0562150fc MFC r257531:
Do not exit with error status after printing data for perftest.

Sponsored by:	Intel
Approved by:	re (glebius)
2013-11-05 15:52:38 +00:00
trociny
6952838572 MFC r257154:
Merging local and remote bitmaps must be protected by hr_amp lock.

This is believed to fix hastd crashes, which might occur during
synchronization, triggered by the failed assertion:

 Assertion failed: (amp->am_memtab[ext] > 0),
 function activemap_write_complete, file activemap.c, line 351.

Approved by:	re (glebius)
2013-10-31 20:30:26 +00:00
glebius
60686beab7 Merge r256824 from head:
Provide a working example line for an interface with 1 address running
  with CARP.

  Currently, we've got a problem that interface isn't IFF_UP at the time
  we assign it a redundant address, and the latter gets stuck in INIT state.
  Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state.

  A proper fix is kernel side and appeared to be non-trivial, not to be
  checked in before 10.0-RELEASE.

  Submitted by:   Ole Myhre <ole.myhre dataoppdrag.no>

Approved by:	re (kib)
2013-10-29 09:24:39 +00:00
mav
58e4e84a2a MFC r256317:
Fix mode page length calculation to remove last garbage line from the
`camcontrol mode daX -l` output.

Approved by:	re (gjb)
2013-10-11 17:10:28 +00:00
trasz
64cccdad5e Remove unimplemented options from iscsi.conf(5) manual page, mention
that it's being used by both initiators, and change the title to make
it more easily searchable.

Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation
2013-10-10 11:28:20 +00:00
jimharris
bb66cfd2ae Extend some 32-bit fields and variables to 64-bit to prevent overflow
when calculating stats in nvmecontrol perftest.

Sponsored by:	Intel
Reported by:	Joe Golio <joseph.golio@emc.com>
Reviewed by:	carl
Approved by:	re (hrs)
MFC after:	1 week
2013-10-08 15:47:22 +00:00
glebius
f1b97b5667 When destination parameter is missing, exit with a clear synopsis,
instead of writing to kernel and printing EINVAL description.

PR:		bin/181532
Submitted by:	Kurt Jaeger <fbsd-pr opsec.eu>
Approved by:	re (hrs)
2013-10-08 08:16:17 +00:00
markj
41bda5b66a Fix an inverted check for the master user in "camcontrol security -U".
PR:		bin/182703
Submitted by:	Scott Burns <scott@bqinternet.com>
Approved by:	re (gjb)
MFC after:	3 days
2013-10-08 04:16:22 +00:00