201898 Commits

Author SHA1 Message Date
mav
220fa555b0 MFC r294811: MFV r294810: 6414 vdev_config_sync could be simpler
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Will Andrews <will@firepipe.net>

illumos/illumos-gate@eb5bb58421
2016-03-20 23:57:46 +00:00
mav
269ad609c3 MFC r294809: MFV r294808:
6421 Add missing multilist_destroy calls to arc_fini

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@57deb23282
2016-03-20 23:56:59 +00:00
mav
09be69d816 MFC r294807: MFV r294806:
6388 Failure of userland copy should return EFAULT

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Richard Yao <ryao@gentoo.org>

illumos/illumos-gate@c71c00bbe8
2016-03-20 23:56:02 +00:00
mav
70ee7f1074 MFC r294805: MFV r294804:
6386 Fix function call with uninitialized value in vdev_inuse

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Richard Yao <ryao@gentoo.org>

illumos/illumos-gate@5bdd995ddb
2016-03-20 23:54:59 +00:00
mav
04fd939370 MFC r294803: MFV r294802: 6334 Cannot unlink files when over quota
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Simon Klinkert <simon.klinkert@gmail.com>

illumos/illumos-gate@6575bca013
2016-03-20 23:54:05 +00:00
mav
6ddeef851f MFC r294801: MFV r294800: 6385 Fix unlocking order in zfs_zget
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Andriy Gapon <avg@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Richard Yao <ryao@gentoo.org>

illumos/illumos-gate@eaef6a96de
2016-03-20 23:52:45 +00:00
mav
fdf476c02a MFC r294799: MFV r294798:
6292 exporting a pool while an async destroy is running can leave entries
in the deferred tree

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Fabian Keil <fk@fabiankeil.de>
Approved by: Gordon Ross <gordon.ross@nexenta.com>

illumos/illumos-gate@a443cc80c7
2016-03-20 23:51:56 +00:00
mav
a70881014d MFC r294797: MFV r294796:
6319 assertion failed in zio_ddt_write: bp->blk_birth == txg

Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@b39b744be7

This is revert of 5693.
2016-03-20 23:51:11 +00:00
mav
f615b9a298 MFC r294794: MFV r294793:
6367 spa_config_tryenter incorrectly handles the multiple-lock case

Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Steven Hartland <steven.hartland@multiplay.co.uk>
Approved by: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@e495b6e673
2016-03-20 23:49:58 +00:00
mav
b000be02f6 MFC r294625 (by trasz):
Fix ru_oublocks accounting for ZFS. There are two code paths that can be
called from zfs_write() - one of them, through dmu_write(), was handled
correctly; the other wasn't.

Differential Revision:  https://reviews.freebsd.org/D4923
2016-03-20 23:48:26 +00:00
mav
1a99a787d7 MFC r293677 (by asomers): Record physical path information in ZFS Vdevs
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c:
        If available, record the physical path of a vdev in ZFS meta-data.
        Do this both when opening the vdev, and when receiving an attribute
        change notification from GEOM.

        Make vdev_geom_close() synchronous instead of deferring its work to
        a GEOM event handler. There is no benefit to deferring the work and
        this prevents a future open call from referencing a consumer that is
        scheduled for destruction. The close followed by an immediate open
        will occur during a vdev reprobe triggered by any type of I/O error.

        Consolidate vdev_geom_close() and vdev_geom_detach() into
        vdev_geom_close() and vdev_geom_close_locked(). This also moves the
        cross linking operations between vdev and GEOM consumer into a
        single place (linking in vdev_geom_attach() and unlinking in
        vdev_geom_close_locked()).

Differential Revision:  https://reviews.freebsd.org/D4524
2016-03-20 23:43:26 +00:00
mav
bec00cfc57 MFC r292653 (by bapt): Report an error if zdb cannot initialize zfs
If the zfs module is not present and not loadable, report an error
to the user instead of crashing

Differential Revision:  https://reviews.freebsd.org/D4691
2016-03-20 23:29:58 +00:00
mav
2fc6ce7ddf MFC r291637 (by bdrewery): Fix the build for non-amd64. 2016-03-20 23:26:52 +00:00
mav
9597dcad59 MFC r290266 (by avg):
zfs: allow the lookup of extended attributes of an unlinked file

That's required for extattr_get_fd(2) and the like to work properly.

PR:		203201
2016-03-20 23:20:16 +00:00
mav
63baaab418 MFC r274627 (by avg):
Revert r269093 which introduced physical zio alignment transform

Size of physical ZIOs must never be implicitly adjusted, it's
a responsibility of a caller to make sure that such a ZIO has proper offset
and size.

Discussed with: delphij, gibbs
2016-03-20 20:37:26 +00:00
mav
73d86b1cb3 MFV r258597 (by pjd):
When append-only, immutable or read-only flag is set don't allow for
hard links creation. This matches UFS behaviour.

Reported by:    Oleg Ginzburg <olevole@olevole.ru>
2016-03-20 20:33:03 +00:00
mav
1beb94523f MFC r262990: MFV r262983:
4638 Panic in ZFS via rfs3_setattr()/rfs3_write(): dirtying snapshot!

illumos/illumos-gate@2144b121c0
2016-03-20 20:31:30 +00:00
mav
ca01d985f9 MFC r272359 (by will):
zfsvfs_create(): Refuse to mount datasets whose names are too long.

This is checked for in the zfs_snapshot_004_neg STF/ATF test (currently
still in projects/zfsd rather than head).

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c:
- zfsvfs_create(): Check whether the objset name fits into
  statfs.f_mntfromname, and return ENAMETOOLONG if not.  Although
  the filesystem can be unmounted via the umount(8) command, any
  interface that relies on iterating on statfs (e.g. libzfs) will
  fail to find the filesystem by its objset name, and thus assume
  it's not mounted.  This causes "zfs unmount", "zfs destroy",
  etc. to fail on these filesystems, whether or not -f is passed.

MFSpectraBSD:   974872 on 2013/08/09
2016-03-20 20:27:52 +00:00
mav
09bcf11255 MFC r277503 (by will): Ignore sync requests from the system syncher,
i.e. VFS_SYNC(waitfor=MNT_LAZY).

ZFS already commits outstanding data every zfs_txg_timeout seconds, so these
syncs are unnecessarily intrusive.

MFSpectraBSD:   1105759 on 2014/12/11
2016-03-20 20:25:36 +00:00
mav
b2ea9835e6 MFC r277501 (by will): Eliminate an #ifdef illumos for zfs_ioc_rename().
Since allow_mounted is a FreeBSD-specific change, default to B_TRUE, then
locally check for the magic bit.  Unconditionally check allow_mounted below.
Convert the setting of allow_mounted to an explicit boolean.

MFSpectraBSD:   672578 (in part) on 2013/07/19
2016-03-20 20:23:20 +00:00
mav
b4affa0246 MFC r286223 (by smh): Fix KSTACK_PAGES check in ZFS module
The check introduced by r285946 failed to add the dependency on
opt_kstack_pages.h which meant the default value for the platform instead
of the customised options KSTACK_PAGES=X was being tested.

Also wrap in #ifdef __FreeBSD__ for portability.
2016-03-20 20:20:37 +00:00
mav
495e63a668 MFC r274304 (by delphij): MFV r274272 and diff reduction with upstream.
Illumos issue:
    5244 zio pipeline callers should explicitly invoke next stage
2016-03-20 20:12:14 +00:00
mav
e727ce4355 MFC r277300 (by smh): Mechanically convert cddl sun #ifdef's to illumos
Since the upstream for cddl code is now illumos not sun, mechanically
convert all sun #ifdef's to illumos #ifdef's which have been used in all
newer code for some time.

Also do a manual pass to correct the use if #ifdef comments as per style(9)
as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos.
2016-03-20 20:00:25 +00:00
mav
4a8be18484 MFC r271785:
Reorder sysctls for spa.c global tunables; add sysctl for ccw_retry_interval.
2016-03-20 19:21:20 +00:00
mav
c46c1536ee MFC r269222: Reschedule the 'deadman' callout after handling, this makes our
code behave more like it is on Solaris.

Differential Revision: https://phabric.freebsd.org/D457
2016-03-20 19:14:51 +00:00
mav
4796073791 MFC r271788 (by will):
Enable ZFS debug flags to be modified via vfs.zfs.debug_flags.

This is primarily only of interest to ZFS developers, but it makes it
easier to get additional debugging.

MFSpectraBSD:   517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs)
2016-03-20 19:11:17 +00:00
mav
c2202a0e09 MFC r277492 (by will): Add vfs.zfs.reference_tracking_enable sysctl/tunable.
This is primarily for developer/debugging use; it enables built-in tagged
tracking of refcounts inside ZFS.  It can only be enabled from the loader,
since it modifies how in-core state is managed.  Default remains disabled.
2016-03-20 19:07:12 +00:00
mav
5cc913755e MFC r271781i (by will):
bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.

If bpobj_space() returned non-zero here, the sublist would have been
left open, along with the bonus buffer hold it requires.  This call
does not invoke any calls to bpobj_close() itself.

This bug doesn't have any known vector, but was found on inspection.

MFC after:      1 week
Sponsored by:   Spectra Logic
Affects:        All ZFS versions starting 21 May 2010 (illumos cde58dbc)
MFSpectraBSD:   r1050998 on 2014/03/26
2016-03-20 18:56:03 +00:00
mav
92a6d794f0 MFC r264670: MFV r264667:
4752 fan out read zio taskqs

illumos/illumos-gate@1b497ab83e
2016-03-20 16:00:05 +00:00
mav
4909ce3dde MFC r256613, r256862: MFprojects/camlock r254763:
Move tq_enqueue() call out of the queue lock for known handlers (actually
I have found no others in the base system).  This reduces queue lock hold
time and congestion spinning under active multithreaded enqueuing.
2016-03-20 14:37:37 +00:00
mav
dd8690af3e MFC r256612: MFprojects/camlock r254685:
Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status.
2016-03-20 14:11:37 +00:00
np
f123f2ce18 MFC r277759 (by jhb@)
Fix a couple of panics when detaching from a cxgbe/cxl interface that was
never brought up:
- Allow NULL to be passed to sglist_free().
- Don't try to stop an interface that was never fully initialized.

PR:		208136
2016-03-20 05:01:40 +00:00
pfg
f36ffd2dd3 MFC r295822:
qlxgb: fix mismatch.

Found by:	PVS Static Analysis
Reviewed by:	davidcs
2016-03-20 03:09:01 +00:00
pfg
52c7a801b1 MFC r295811:
Ext2: cleanup setting of ctime/mtime/birthtime.

This adopts the same change as r291936 for UFS.
Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and
copy the value into the inode.

This keeps the behaviour cleaner and is consistent with UFS.

Reviewed by:	bde
2016-03-19 23:07:05 +00:00
jgh
33c5dde7f4 MFC: 296167
- address obsolete Kerberos options

PR:		205168
Submitted by:	kevin@bostoncrypto.com
Reviewed by:	bjk
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5430
2016-03-19 22:56:20 +00:00
smh
b66177d8a6 MFC r296922:
Prevent invalid ixgbe advertise setting warning

Sponsored by:	Multiplay
2016-03-19 11:35:53 +00:00
dumbbell
58a3fd2c52 drm: Fix dev->ioctl_count references leak
This fixes the following error:
kernel: error: [drm:pid1167:drm_release] *ERROR* Device busy: 2

Because of that, drm_lastclose() was not called, leading to a few memory
leaks once the driver was unloaded.

MFC of:		r296674
2016-03-18 22:52:11 +00:00
bdrewery
2af531d10d MFC r296707:
Add missing CLEANFILES.
2016-03-18 18:26:07 +00:00
bdrewery
fff91969c9 MFC r296643:
Fix make -n upgrade_checks.
2016-03-18 18:24:36 +00:00
mav
34ec6b2094 MFC r296919: Fix small memory leak on attempt to access deleted snapshot. 2016-03-18 13:32:00 +00:00
mav
1625cb7688 MFC r296653: Allow standard commands for "unknown" classes in RESCUE mode.
For example, it allows quite useful `geom disk list` command.
2016-03-18 13:29:43 +00:00
kib
998379240e MFC r296388:
Pass MNTK_NO_IOPF and MNTK_UNMAPPED_BUFS flags from the lower
filesystem to the nullfs mount.
2016-03-18 01:35:03 +00:00
allanjude
95e874ef1f MFC: r296988
Remove 50% ZFS conditional from bsdinstall/zfsboot

Approved by:	re (marius)
2016-03-17 21:00:43 +00:00
asomers
a3cbd495a3 MFC r295900, r295768 to usr.sbin/iostat
r295768 | asomers | 2016-02-18 13:08:01 -0700 (Thu, 18 Feb 2016) | 14 lines

Fix compiler warnings in iostat

Raise WARNS from 1 to 6 (the default)
Fix warnings:
* Use C99 designated initializers for structs, and initialize all fields
* Mark global variables as static
* Mark unused function arguments
* Be careful about signed/unsigned comparisons

r295900 | asomers | 2016-02-22 14:40:53 -0700 (Mon, 22 Feb 2016) | 10 lines

Fix the usr.sbin/iostat build with GCC, broken by r295768

Renamed some local variables for compatibility with -Wshadow
2016-03-17 20:29:10 +00:00
asomers
897095a018 MFC r293229, r293833 to usr.sbin/rpcbind
r293833 | asomers | 2016-01-13 10:33:50 -0700 (Wed, 13 Jan 2016) | 16 lines

Fix Coverity warnings regarding r293229

rpcbind/check_bound.c
        Fix CID1347798, a memory leak in mergeaddr.

rpcbind/tests/addrmerge_test.c
        Fix CID1347800 through CID1347803, memory leaks in ATF tests.  They
        are harmless because each ATF test case runs in its own process, but
        they are trivial to fix.  Fix a few other leaks that Coverity didn't
        detect, too.

r293229 | asomers | 2016-01-05 17:00:11 -0700 (Tue, 05 Jan 2016) | 36 lines

"source routing" in rpcbind

Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
        If the address on which a request was received is known, pass that
        to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
        comment indicates the parameter is supposed to mean. The previous
        behavior is that clnt_uaddr would contain the address from which the
        client sent the request.

usr.sbin/rpcbind/util.c
        Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
        if one is found. Refactor the relevant portion of the function for
        clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
        Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
        Constify some function arguments
2016-03-17 20:00:49 +00:00
pfg
65e756c88a MFC r294504, r294652, r294653, r294655:
ext2fs: Bring back the htree dir_index implementation.

The htree dir_index is perhaps one of the most characteristic
features of the linux ext3 implementation. It was removed
in r281670, due to repeated bug reports.

Damjan Jovanic detected and fixed three bugs and did some
stress testing by building Apache OpenOffice on top of it
so it is now in good shape to bring back.

Differential Revision:	https://reviews.freebsd.org/D5007

Submitted by:	Damjan Jovanovic
Reviewed by:	pfg
RelNotes:	yes
2016-03-17 19:28:15 +00:00
bdrewery
5c5f0dbf8c MFC r296623:
Remove redundant files already tracked by
  tools/build/mk/OptionalObsoleteFiles.inc.
2016-03-17 01:02:34 +00:00
mp
c2cc321146 MFC 296416:
Signal handling within tcsh vfork code path will conflict with some system
libraries (such as libthr) which maintain their own signal state. This
change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for
the signals the child modifies before it execs.

Reviewed by:	kib, rwatson
Reported by:	kib
2016-03-17 00:32:29 +00:00
glebius
4c0b9655c9 Merge r296956:
Due to invalid use of a signed intermediate value in the bounds checking
  during argument validity verification, unbound zero'ing of the process LDT
  and adjacent memory can be initiated from usermode.

Submitted by:   CORE Security
Patch by:       kib
Security:       SA-16:15
2016-03-16 22:35:55 +00:00
ian
3193ea52fd MFC r296807: (this time with 100% fewer unintended changes mixed in)...
Require firewall setup before running rc.d/netwait, otherwise the ping
  packets sent by netwait may not get through.

PR:		207916
2016-03-16 16:52:31 +00:00