202056 Commits

Author SHA1 Message Date
mav
dbe6d3f59a MFC r296510, r296563, r296567: MFV r296505:
6531 Provide mechanism to artificially limit disk performance

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@97e8130957
2016-03-21 00:13:39 +00:00
mav
9a698f756e MFC r296021 (by smh): Removed unused label and fix mutex_exit order
Remove unused done label from zfs_setacl fixing PVS-Studio V729.

Fix mutex_exit order to mirror the mutex_enter order.
2016-03-21 00:09:56 +00:00
mav
745a33b96e MFC r295125: MFV r294821:
6529 Properly handle updates of variably-sized SA entries.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Andriy Gapon <avg@icyb.net.ua>

illumos/illumos-gate@e7e978b1f7

During the update process in sa_modify_attrs(), the sizes of existing
variably-sized SA entries are obtained from sa_lengths[]. The case where
a variably-sized SA was being replaced neglected to increment the index
into sa_lengths[], so subsequent variable-length SAs would be rewritten
with the wrong length. This patch adds the missing increment operation
so all variably-sized SA entries are stored with their correct lengths.

Another problem was that index into attr_desc[] was increased even when
an attribute was removed. If that attribute was not the last attribute,
then the last attribute was lost.
2016-03-21 00:07:56 +00:00
mav
343f418e75 MFC r295047: MFV 295046:
6358 A faulted pool with only unavailable vdevs triggers assertion
failure in libzfs

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Serban Maduta <serban.maduta@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Vatca <dan.vatca@gmail.com>

illumos/illumos-gate@b289d045e0
2016-03-21 00:06:42 +00:00
mav
be9d2c4881 MFC r294820: MFV r294819: 6495 Fix mutex leak in dmu_objset_find_dp
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Albert Lee <trisk@omniti.com>
Author: Steven Hartland <steven.hartland@multiplay.co.uk>

illumos/illumos-gate@2bad22584d
2016-03-21 00:04:53 +00:00
mav
9f09540feb MFC r294817: MFV r294816:
4986 receiving replication stream fails if any snapshot exceeds refquota

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
Author: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@5878fad70d
2016-03-21 00:03:55 +00:00
mav
fd712914d7 MFC r294815: MFV r294814: 6393 zfs receive a full send as a clone
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Paul Dagnelie <pcd@delphix.com>

illumos/illumos-gate@68ecb2ec93

This allows to do a full (non-incremental send) and receive it as a clone
of an existing dataset. It can leverage nopwrite to share blocks with the
origin. This can be used to change the relationship of datasets on the
target. For example, maybe on the source you have:

A ---- B ---- C

And you have sent to the target a full of B, and the incremental B->C:

B ---- C

You later realize that you want to have A on the target. You will have to
do a full send of A, but nopwrite can save you space on the target if you
receive it as a clone of B, assuming that A and B have some blocks inxi
common:

B ---- C
 \
  A
2016-03-21 00:01:59 +00:00
mav
bdf1ebb4e0 MFC r294813: MFV r294812:
6434 sa_find_sizes() may compute wrong SA header size

Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Andriy Gapon <avg@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: James Pan <jiaming.pan@yahoo.com>

illumos/illumos-gate@3502ed6e7c
2016-03-20 23:58:44 +00:00
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