Commit Graph

197668 Commits

Author SHA1 Message Date
mav
cc4fa4df69 MFC r275478: Swap resource count scopes for used/available space.
Used count should be reported as per-LUN, while available should not.
2014-12-11 00:25:26 +00:00
cy
fef6395777 MFC r275199.
Correctly define constants.
2014-12-10 20:54:23 +00:00
mav
43c3b12592 MFC r275452: Do not corrupt the listen string when parsing it.
This fixes problem with ctld reload when it is configured to listen on two
portals with same IP, but different ports.
2014-12-10 08:53:41 +00:00
mav
4875c0a205 MFC r275446: Plug memory leaks on UNMAP and XCOPY with invalid parameters. 2014-12-10 08:52:47 +00:00
delphij
b24390d7fc MFC r275666:
Fix multiple vulnerabilities in file(1) and libmagic(3).

Security:	FreeBSD-SA-14:28.file
Security:	CVE-2014-3710, CVE-2014-8116, CVE-2014-8117
2014-12-10 08:26:53 +00:00
delphij
25ca306958 MFC r275665:
Fix buffer overflow in stdio.

Security:	FreeBSD-SA-14:27.stdio
Security:	CVE-2014-8611
2014-12-10 08:24:02 +00:00
rpaulo
88952b61c5 MFC r275376:
Allow multiple devices to mmap.  It's impossible to prevent this with
  checks on the open/close functions.
2014-12-09 17:03:14 +00:00
trasz
c131c42ed7 MFC r274310:
Add HISTORY section to ctld(8).

Sponsored by:	The FreeBSD Foundation
2014-12-09 11:52:36 +00:00
trasz
35a0788239 MFC r274308:
Add support for sending redirections to iSCSI target.

MFC r274309:

Fix several nits in redirection handling - don't use wrong CSG,
and avoid use-after-free.

Sponsored by:	The FreeBSD Foundation
2014-12-09 11:50:50 +00:00
dim
ace7dfdc9c MFC r275386:
Let GNU ld be less obscure about missing symbols and DSOs.  If the BFD
object looks like a typical shared library, suggest adding '-l<foo>',
where <foo> has the 'lib' prefix and '.so<bar>' or '.a' suffix removed.

Otherwise, suggest adding '-l:<foo>', where <foo> is the full DT_SONAME.

Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by:	EMC / Isilon storage division
Reviewed by:	emaste
PR:		194296
Differential Revision: https://reviews.freebsd.org/D1152
2014-12-09 07:15:53 +00:00
bryanv
5ce5864383 MFC r274322:
Attempt to report a better error if sanitize is not supported
2014-12-09 07:03:49 +00:00
delphij
04dbe28cc6 MFC r275071:
Reinstitate send() after syslogd restarts.

In r228193 the test of CONNPRIV have been moved to before the _usleep
and send in vsyslog().  When syslogd restarts, this would prevent the
message being logged after the disconnect/connect dance for
scenario #1.

PR:		194751
Submitted by:	Peter Creath <pjcreath+freebsd gmail com>
Reviewed By:	glebius
2014-12-09 00:47:02 +00:00
avg
0fb6d9ca37 MFC r275046: whitespace and cosmetic changes in callout_reset family of macros
Not applicable to earlier releases.
2014-12-08 13:19:29 +00:00
avg
36fdb56baa MFC r275045: callout(9): add sbt flavors of callout_schedule
Not applicable to earlier releases.
2014-12-08 13:13:17 +00:00
avg
c07a7147df MFC r274628: l2arc: restore correct rounding up of asize of compressed data 2014-12-08 13:06:44 +00:00
trasz
379a1af59c MFC r274277:
ctld(8) doesn't require -lcam or -lssl; remove those from DPADD and LDADD.

Sponsored by:	The FreeBSD Foundation
2014-12-08 11:28:08 +00:00
mav
16ad04df25 MFC r275368:
When passing LUN IDs through treat ASCII values as fixed-length, not
interpreating NULLs as EOLs, but converting them to spaces.

SPC-4 does not tell that T10-based IDs should be NULL-terminated/padded.
And while it tells that it should include only ASCII chars (0x20-0x7F),
there are some USB sticks (SanDisk Ultra Fit), that have NULLs inside
the value.  Treating NULLs as EOLs there made those LUN IDs non-unique.
2014-12-08 09:47:49 +00:00
jilles
26dad09e50 MFC r267265: truncate: Detect integer overflow, fix relative sizes, add tests.
The change to expand_number (r204654) broke detection of too large sizes and
relative sizes ('+'/'-').

Also add some tests.

The usr.bin/truncate/Makefile is slightly different in the MFC because
src.opts.mk does not exist in stable/10.

PR:		190735
Submitted by:	Kirk Russell
2014-12-07 22:30:54 +00:00
brooks
0ba04a3a67 MFC r263928:
Use the correct variable name in the example code.

PR:		195749
2014-12-06 17:50:37 +00:00
mav
72641b76c8 MFC r274843, r274845:
Move icl_pdu_get_data() and xpt_done() out of initiator's session lock.

During heavy reads data copying in icl_pdu_get_data() may consume large
percent of CPU time.  Moving it out of the lock significantly reduces
lock hold time and respectively lock congestion on read operations.
2014-12-06 07:30:08 +00:00
markj
dd6a87838b MFC r271695:
Fix some incorrect endianness checks.
2014-12-05 18:55:31 +00:00
ngie
bb7db53959 MFC r275170:
Convert sbin/mdconfig/tests from prove format tests to ATF format tests

  As a side effect...
  1. The tests now checks for the root user before continuing with kyua, which is
     more visible than the test being skipped with the TAP protocol
  2. The tests work with devices that aren't /dev/md0 by caching the device
     attached during the test to a file, and later use the cached information to
     detach the device in the cleanup routine
  3. The tests no longer require perl to run

  PR: 191191
  Sponsored by: EMC / Isilon Storage Division
2014-12-05 12:51:27 +00:00
ngie
dabf881564 MFC r274365:
Revert WiP to contrib/tzcode accidentally committed with r274364
2014-12-05 12:25:36 +00:00
ngie
32112cfc28 MFC r274364:
Add baud rate support to telnet(1)

  This implements part of RFC-2217

  It's based off a patch originally written by Sujal Patel at Isilon, and
  contributions from other Isilon employees.

  PR: 173728
  Phabric: D995
  Reviewed by: markj, markm
  Sponsored by: EMC / Isilon Storage Division
2014-12-05 12:23:29 +00:00
ngie
2ceba1b134 MFC r272057,r272083,r272084,r272087,r274016:
r272057:

  Import pjdfstest from ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91

  - Remove tools/regression/pjdfstest
  - Add upgrade directions for contrib/pjdfstest
  - Add a note to UPDATING for the move (the reachover Makefiles are coming
    soon)

  Functional differences:
  - ftruncate testcases are added from upstream (github)

  Non-functional differences:
  - The copyright for the project has been updated to 2012
  - pjd's contact information has been updated

  Discussed with: -testing, jmmv, pjd
  Sponsored by: EMC / Isilon Storage Division

r272083:

  Expect ELOOP on Darwin/Linux with "O_NOFOLLOW was specified and the target is a
  symbolic link" case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris,
  etc)

  Sponsored by: EMC / Isilon Storage Division

r272084:

  Fix the executed testplan count

  Sponsored by: EMC / Isilon Storage Division

r272087:

  Increase the memory disk size in the following testcases to avoid mount
  failures, which would cause cascade failures in the rest of the test
  run:

  link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t

  Fail quickly in all of the testcases if mdconfig, mount, umount, etc
  fails to avoid issues similar to this in the future

  Submitted by: Casey Peel <cpeel@isilon.com>
  Sponsored by: EMC / Isilon Storage Division

r274016:

  Integrate pjdfstest test suite execution into kyua

  pjdfstest execution is opt-in and must be done as root due to some of the
  assumptions made by the test suite and lack of error checking in the non-root
  case

  A description of how to execute pjdfstest with kyua is provided in
  share/pjdfstest/README

  Phabric: D824 (an earlier prototype patch)
  Relnotes: yes
  Sponsored by: EMC / Isilon Storage Division
2014-12-05 11:44:18 +00:00
kib
f88754a36c MFC r275206:
Assert the state of the process lock and sigact mutex in
kern_sigprocmask() and reschedule_signals().
2014-12-05 09:30:07 +00:00
ngie
d21006ce12 MFC r271796 (by will):
Use 'cc' for the C compiler instead of 'gcc'.

  Sponsored by:	Spectra Logic
  MFSpectraBSD:	1079507 on 2014/07/24
2014-12-05 08:46:15 +00:00
rpaulo
2add70e7a9 MFC r275420:
gpioctl: don't print the command line arguments.

PR:	  	195330
Submitted by:	Scott Ellis jumpnowtek at gmail.com
2014-12-05 07:51:50 +00:00
mav
f55f3b5eab MFC r272937: Fix r272936 build with old GCC. 2014-12-05 07:48:22 +00:00
mav
2ba95e01e3 MFC r268395:
Pass correct command that should be aborted to ISPCTL_ABORT_CMD.

This makes XPT_ABORT to work for me on initiator side of isp(4).
Previous code was trying to abort the XPT_ABORT itself and failed.
2014-12-05 07:46:28 +00:00
mav
19732a0540 MFC r274248: Remove unused assignments, noticed by Clang analyzer. 2014-12-05 07:29:31 +00:00
mav
c2a2522fc4 MFC r274805:
Make cfiscsi_offline() synchronous, waiting for connections termination
before return.  This should make ctld restart more clean and predictable.
2014-12-05 07:25:02 +00:00
mav
0d78a1c549 MFC r274795:
Close race between cfiscsi_offline() and new connection arrival.

Incoming connection should be either rejected or accepted and terminated.
2014-12-05 07:24:17 +00:00
mav
cc2f0f4af5 MFC r274785: Partially reconstruct Active/Standby clusting.
In this mode one head is in Active state, supporting all commands, while
another is in Standby state, supporting only minimal LUN discovery subset.

It is still incomplete since Standby state requires reservation support,
which is impossible to do right without having interlink between heads.
But it allows to run some basic experiments.
2014-12-05 07:23:25 +00:00
delphij
ebd3bcb845 MFC r274172 (avg)
fix l2arc compression buffers leak

We have observed that arc_release() can be called concurrently with a
l2arc in-flight write.
Also, we have observed that arc_hdr_destroy() can be called from
arc_write_done() for a zio with ZIO_FLAG_IO_REWRITE flag in similar
circumstances.

Previously the l2arc headers would be freed while leaking their
associated compression buffers.  Now the buffers are placed on
l2arc_free_on_write list for delayed freeing.  This is similar to what
was already done to arc buffers that were supposed to be freed
concurrently with in-flight writes of those buffers.

In addition to fixing the discovered leaks this change also adds some
protective code to assert that a compression buffer associated with a
l2arc header is never leaked.

A new kstat l2_cdata_free_on_write is added.  It keeps a count of
delayed compression buffer frees which previously would have been leaks.

Tested by:      Vitalij Satanivskij <satan@ukr.net> et al
Requested by:   many
Sponsored by:   HybridCluster / ClusterHQ

This is a 10.1-RELEASE errata candidate.
2014-12-05 00:32:33 +00:00
delphij
7fa7d519b4 MFC r274370:
Rename variable name from 'index' to 'idx' to avoid shadowing index(3).

Noticed by:	dim
2014-12-04 23:27:29 +00:00
delphij
d663d42637 MFC r274674:
Add a tunable for spa_slop_shift which controls how much space we
would reserve by default.  Tuning is not recommended.

Relnotes:	yes
2014-12-04 23:26:15 +00:00
delphij
f96a33a8ab MFC r274636:
Sync with userland variant.
2014-12-04 23:21:42 +00:00
delphij
a26baf65aa MFC r274276: MFV r274271:
Improve zdb -b performance:

 - Reduce gethrtime() call to 1/100th of blkptr's;
 - Skip manipulating the size-ordered tree;
 - Issue more (10, previously 3) async reads;
 - Use lighter weight testing in traverse_visitbp();

Illumos issue:
    5243 zdb -b could be much faster
2014-12-04 23:20:44 +00:00
delphij
36b0a2ac49 MFC r274458,274523:
Derive copyright year from src/COPYRIGHT.
2014-12-04 23:19:04 +00:00
delphij
0c96bfd67d MFC r274303:
Apply upstream 13597:3eac1e8e0f4c (git: illumos-gate@aa846ad9):

Initialize tqent_flags in the userland taskq implementation.  Without
this the assertion of tq->tq_freelist != NULL may fail in taskq_destroy.

The problem is that tqent_flags is never initialized in the userland
implementation while the kernel one does initialize it.  Without proper
initialization, the flag may have its lowest bit set, making it treated
as TQENT_FLAG_PREALLOC and never removing taskq_ent_t from tq_freelist.
2014-12-04 23:17:35 +00:00
delphij
0b08d45457 MFC r272044:
Constify a parameter of name2oid.  No functional change.
2014-12-04 23:15:44 +00:00
dim
c882aa6bee MFC r275366:
Pull in r209785 from upstream libc++ trunk (by Marshall Clow):

  Fix a problem exposed by r208825, which caused bind (and other bits of
  libc++) to stop working. And tests

This fix is needed to support clang 3.5.0 and higher, which are more
strict about forming pointer-to-function types with cv-qualifiers or
ref-qualifiers.  See also the upstream PR <http://llvm.org/PR19742> and
<http://llvm.org/viewvc/llvm-project?rev=208825&view=rev>

Reported by:	amdmi3
2014-12-04 01:21:56 +00:00
dim
856a793432 MFC r274922:
Fix the following -Werror warning from clang 3.5.0, while building the
ath kernel module:

sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) {
                    ^
sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs'
#define abs(_a)         __builtin_abs(_a)
                        ^
sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: note: remove the call to '__builtin_abs' since unsigned values cannot be negative
sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs'
#define abs(_a)         __builtin_abs(_a)
                        ^
1 error generated.

This warning occurs because both lp[0] and target are unsigned, so the
subtraction expression is also unsigned, and calling abs() is a no-op.

However, the intention was to look at the absolute difference between
the two unsigned quantities.  Introduce a small static function to
clarify what we're doing, and call that instead.

Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D1212
2014-12-04 01:10:50 +00:00
markj
b431d8bfcf MFC r273488:
Fix some bugs in the error handling of getdevice().

PR:	194506
2014-12-03 19:44:22 +00:00
kib
ec597a3d4e MFC r275120:
Fix SA_SIGINFO | SA_RESETHAND handling, reset disposition after sv_sendsig()
is called.
2014-12-03 10:42:10 +00:00
hselasky
a0061de774 MFC r275110:
Add new USB quirk.

PR:		195372
2014-12-03 09:14:14 +00:00
hselasky
405a965719 MFC r275328 and r275330:
Add missing libraries when linking and fix building of some infiniband
utilities by updating some header file locations and compiler include
directives.

Sponsored by:	Mellanox Technologies
2014-12-03 09:08:04 +00:00
trasz
ea68673881 MFC r274703:
Fix typo.

Sponsored by:	The FreeBSD Foundation
2014-12-03 08:22:13 +00:00
mav
2c60f5a12d MFC r275124: Fix WWNN/WWPN generation for virtual channels. 2014-12-03 07:05:17 +00:00