aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* OpenZFS 5120 - zfs should allow large block/gzip/raidz boot pool (loader ↵Brian Behlendorf2017-04-134-34/+12
| | | | | | | | | | | | | | | | | | | | | | | project) Authored by: Toomas Soome <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Yuri Pankov <[email protected]> Reviewed by: Andrew Stormont <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Don Brady <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - grub-2.02-beta2-422-gcad5cc0 includes support for large blocks. - Commit 8aab121 allowed GZIP[1-9]. - Grub allows pools with multiple top-level vdevs. OpenZFS-issue: https://www.illumos.org/issues/5120 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c8811bd Closes #6007
* Invalidate cache during a zpool labelclearGiuseppe Di Natale2017-04-131-0/+4
| | | | | | | | | | | | Be sure to invalidate a vdev's cache before performing a zpool labelclear. There are cases where the cache is stale because we did some operation that bypassed it, and since we are doing an open with only O_RDWR, we should invalidate it to be safe. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #6009
* OpenZFS 7503 - zfs-test should tail ::zfs_dbgmsg on test failureBrian Behlendorf2017-04-128-3/+99
| | | | | | | | | | | | | | | | | | | Authored by: Pavel Zakharov <[email protected]> Reviewed by: John Kennedy <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Approved by: Gordon Ross <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - Enable internal log for DEBUG builds and in zfs-tests.sh. - callbacks/zfs_dbgmsg.ksh - Dump interal log via kstat. - callbacks/zfs_dmesg.ksh - Dump dmesg log. - default.cfg - 'Test Suite Specific Commands' dropped. OpenZFS-issue: https://www.illumos.org/issues/7503 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/55a1300 Closes #6002
* Fix header inclusions for standards conformanceRichard Yao2017-04-127-4/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | musl's sys/errno.h is literally: /#warning redirecting incorrect #include <sys/errno.h> to <errno.h> /#include <errno.h> It does the same for sys/{poll,signal}.h. This is rather noisy when building ZoL against musl. musl is also correct in pointing out that the correct headers are outside of sys/ according to the single unix specification: http://pubs.opengroup.org/onlinepubs/7908799/xsh/errno.h.html http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.h.html http://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html Lets implement our own sys/* versions of these headers to redirect to the proper userland ones when building in userspace. That will silence the warning. There are also some instances where we include incorrectly from sys/ or from outside of sys/ in userspace only code. In these instances, lets just fix the includes directly. Reviewed-by: George Melikov <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #5993
* Fix `zpool iostat -T d 1` on muslRichard Yao2017-04-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When building on Gentoo against musl, GCC complains: timestamp.c: In function ‘print_timestamp’: timestamp.c:32:19: warning: passing argument 1 of ‘nl_langinfo’ makes integer from pointer without a cast #define _DATE_FMT "%+" ^ timestamp.c:47:21: note: in expansion of macro ‘_DATE_FMT’ fmt = nl_langinfo(_DATE_FMT); ^ The error was wrapped to meet comment style requirements. This code is used by `zpool iostat -T d 1` to print a date and upon testing it, I see no date printed. Lets use D_T_FMT so that something gets printed and if D_T_FMT is not avaliable, then we can fall back to "%+". Reviewed-by: George Melikov <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #5993
* Add missing includes to zed_log.cRichard Yao2017-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.9.4 complains about implicit function declarations when building against musl on Gentoo. zed_log.c: In function ‘zed_log_pipe_open’: zed_log.c:69:7: warning: implicit declaration of function ‘getpid’ (int)getpid()); ^ zed_log.c:71:2: warning: implicit declaration of function ‘pipe’ if (pipe(_ctx.pipe_fd) < 0) ^ zed_log.c: In function ‘zed_log_pipe_close_reads’: zed_log.c:90:2: warning: implicit declaration of function ‘close’ if (close(_ctx.pipe_fd[0]) < 0) ^ zed_log.c: In function ‘zed_log_pipe_wait’: zed_log.c:141:3: warning: implicit declaration of function ‘read’ n = read(_ctx.pipe_fd[0], &c, sizeof (c)); The [-Wimplicit-function-declaration] at the end of each warning has been removed to meet comment style requirements. The man pages say to include <sys/types.h> and <unistd.h>. Doing that silences the warnings. Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #5993
* OpenZFS 7535 - need test for resumed send of top most filesystemBrian Behlendorf2017-04-1215-87/+107
| | | | | | | | | | | | | | | | | Authored by: John Kennedy <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Richard Lowe <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - zfs_share_001_pos.ksh - Older versions of exportfs will match multiple exports that share a common prefix. Reorder the 'fs' list so unshares occur from most to least unique. - zfs_share_005_pos.ksh - Enabled and updated for Linux. OpenZFS-issue: https://www.illumos.org/issues/7535 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ac89d1e Closes #5979
* Skip rate limiting events in zfs_ereport_postGiuseppe Di Natale2017-04-111-3/+3
| | | | | | | | In zfs_ereport_post, if an event is a rate limiting event, immediately return before any processing is done. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5998
* OpenZFS 6865 - want zfs-tests cases for zpool labelclear commandYuri Pankov2017-04-1115-105/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Authored by: Yuri Pankov <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: John Kennedy <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: loli10K <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - Updated 'zpool labelclear' and 'zdb -l' such that they attempt to find a vdev given solely its short name. This behavior is consistent with the upstream OpenZFS code and the test cases depend on it. The actual implementation differs slightly due to device naming conventions on Linux. - auto_online_001_pos, auto_replace_001_pos and add-o_ashift test cases updated to expect failure when no label exists. - read_efi_label() and zpool_label_disk_check() are read-only operations and should use O_RDONLY at open time to enforce this. - zpool_label_disk() and zpool_relabel_disk() write the partition information using O_DIRECT an fsync() and page cache invalidation to ensure a consistent view of the device. - dump_label() in zdb should invalidate the page cache in order to get the authoritative label from disk. OpenZFS-issue: https://www.illumos.org/issues/6865 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c95076c Closes #5981
* Fix size inflation in spa_get_worst_case_asize()LOLi2017-04-105-4/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we try assign a new transaction to a TXG we must know beforehand if there is sufficient free space on disk. This is to decide, in dmu_tx_assign(), if we should reject the TX with ENOSPC. We rely on spa_get_worst_case_asize() to inflate the size of our logical writes by a factor of spa_asize_inflation which is calculated as: (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 The problem with the current implementation is that we don't take into account what happens with very small writes on VDEVs with large physical block sizes. Consider the case of writes to a dataset with recordsize=512, copies=3 on a VDEV with ashift=13 (usually SSD with 8K block size): every logical IO will end up allocating 3 * 8K = 24K on disk, so 512 bytes multiplied by 48, which is double the size we account for. If we allow this kind of writes to be assigned a TX it is possible, when the pool is almost full, to trigger an allocation failure (ENOSPC) in the ZIO pipeline, which will in turn result in the whole pool being suspended. The bug is fixed by using, in spa_get_worst_case_asize(), the MAX() value chosen between the logical io size from zfs_write() and the maximum physical block size used among our VDEVs. Reviewed by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #5941
* OpenZFS 8005 - poor performance of 1MB writes on certain RAID-Z configurationsMatthew Ahrens2017-04-101-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Authored by: Matt Ahrens <[email protected]> Reviewed by: Saso Kiselkov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Don Brady <[email protected]> Ported-by: Matt Ahrens <[email protected]> RAID-Z requires that space be allocated in multiples of P+1 sectors, because this is the minimum size block that can have the required amount of parity. Thus blocks on RAIDZ1 must be allocated in a multiple of 2 sectors; on RAIDZ2 multiple of 3; and on RAIDZ3 multiple of 4. A sector is a unit of 2^ashift bytes, typically 512B or 4KB. To satisfy this constraint, the allocation size is rounded up to the proper multiple, resulting in up to 3 "pad sectors" at the end of some blocks. The contents of these pad sectors are not used, so we do not need to read or write these sectors. However, some storage hardware performs much worse (around 1/2 as fast) on mostly-contiguous writes when there are small gaps of non-overwritten data between the writes. Therefore, ZFS creates "optional" zio's when writing RAID-Z blocks that include pad sectors. If writing a pad sector will fill the gap between two (required) writes, we will issue the optional zio, thus doubling performance. The gap-filling performance improvement was introduced in July 2009. Writing the optional zio is done by the io aggregation code in vdev_queue.c. The problem is that it is also subject to the limit on the size of aggregate writes, zfs_vdev_aggregation_limit, which is by default 128KB. For a given block, if the amount of data plus padding written to a leaf device exceeds zfs_vdev_aggregation_limit, the optional zio will not be written, resulting in a ~2x performance degradation. The problem occurs only for certain values of ashift, compressed block size, and RAID-Z configuration (number of parity and data disks). It cannot occur with the default recordsize=128KB. If compression is enabled, all configurations with recordsize=1MB or larger will be impacted to some degree. The problem notably occurs with recordsize=1MB, compression=off, with 10 disks in a RAIDZ2 or RAIDZ3 group (with 512B or 4KB sectors). Therefore this problem has been known as "the 1MB 10-wide RAIDZ2 (or 3) problem". The problem also occurs with the following configurations: With recordsize=512KB or 256KB, compression=off, the problem occurs only in rarely-used configurations: * 4-wide RAIDZ1 with recordsize=512KB and ashift=12 (4KB sectors) * 4-wide RAIDZ2 (either recordsize, either ashift) * 5-wide RAIDZ2 with recordsize=512KB (either ashift) * 6-wide RAIDZ2 with recordsize=512KB (either ashift) With recordsize=1MB, compression=off, ashift=9 (512B sectors) * RAIDZ1 with 4 or 8 disks * RAIDZ2 with 4, 8, or 10 disks * RAIDZ3 with 6, 8, 9, or 10 disks With recordsize=1MB, compression=off, ashift=12 (4KB sectors) * RAIDZ1 with 7 or 8 disks * RAIDZ2 with 4, 5, or 10 disks * RAIDZ3 with 6, 9, or 10 disks With recordsize=2MB and larger (which can only be selected by changing kernel tunables), many configurations are affected, including with higher numbers of disks (up to 18 disks with recordsize=2MB). Increase zfs_vdev_aggregation_limit to allow the optional zio to be aggregated, thus eliminating the problem. Setting it to 256KB fixes all commonly-used configurations. The solution is to aggregate optional zio's regardless of the aggregation size limit. Analysis sponsored by Intel Corp. OpenZFS-issue: https://www.illumos.org/issues/8005 OpenZFS-commit: https://github.com/openzfs/openzfs/pull/321 Closes #5931
* OpenZFS 2932 - support crash dumps to raidz, etc. poolsGiuseppe Di Natale2017-04-104-1/+37
| | | | | | | | | | | | | | | Authored by: Bill Pijewski <[email protected]> Reviewed by: Jerry Jelinek <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/2932 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/810e43b Closes #5984 Closes #5216
* zfstest - replace dircmp with diffGeorge Melikov2017-04-093-9/+9
| | | | | | | | | `dircmp` doesn't exist in Linux while `diff` is already used by zfstests on all platforms. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Wren Kennedy <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #5996
* zfstest reservation_009_pos.sh missed backslashGeorge Melikov2017-04-091-1/+1
| | | | | | | Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Wren Kennedy <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #5997
* OpenZFS 8023 - Panic destroying a metaslab deferred range treeGeorge Wilson2017-04-095-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | Authored by: George Wilson <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed by: Brad Lewis <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Saso Kiselkov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> We don't want to dirty any data when we're in the final txgs of the pool export logic. This change introduces checks to make sure that no data is dirtied after a certain point. It also addresses the culprit of this specific bug – the space map cannot be upgraded when we're in final stages of pool export. If we encounter a space map that wants to be upgraded in this phase, then we simply ignore the request as it will get retried the next time we set the fragmentation metric on that metaslab. OpenZFS-issue: https://www.illumos.org/issues/8023 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/2ef00f5 Closes #5991
* OpenZFS 5380 - receive of a send -p stream doesn't need to try renaming ↵Andriy Gapon2017-04-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | snapshots Authored by: Andriy Gapon <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> recv_incremental_replication() takes care of things like removing datasets that have been removed on the sending side, detecting renamed datasets, ensuring that all datasets in the affected hierarchy have the same properties as their counterparts on the sending side. All of the above are not necessary if we are receiving a stream for a single dataset that has been generated with zfs send -p, that is, a stream that includes properties. zfs_receive_one() already takes care of applying the properties to the received datasets. OpenZFS-issue: https://www.illumos.org/issues/5380 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/b8ab927 Closes #5990
* OpenZFS 8046 - Let calloc() do the multiplication in libzfs_fru_refreshPedro Giffuni2017-04-091-1/+1
| | | | | | | | | | | | | | Authored by: Pedro Giffuni <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8046 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/3a3c0d5 Closes #5989
* OpenZFS 8027 - tighten up dsl_pool_dirty_deltaAndriy Gapon2017-04-091-1/+1
| | | | | | | | | | | | | | | Authored by: Andriy Gapon <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Serapheim Dimitropoulos <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8027 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/642668d Closes #5988
* zfs_receive_010_pos.ksh local => typeset changeGeorge Melikov2017-04-091-8/+8
| | | | | | | | Ksh uses `typeset`, `local` is a Bash analog. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Wren Kennedy <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #5995
* zfstests cli_user/misc/setup.ksh space missedGeorge Melikov2017-04-091-1/+1
| | | | | | | | Ksh syntax requires a space after `!` in if statement. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Wren Kennedy <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #5994
* OpenZFS 7404 - rootpool_007_neg, bootfs_006_pos and bootfs_008_neg tests ↵Toomas Soome2017-04-0711-108/+68
| | | | | | | | | | | | | | | | | | | | | | | | fail with the loader project bits Authored by: Toomas Soome <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed by: Marcel Telka <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Richard Lowe <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - Removed gzip and zle compression restriction on bootfs datasets. Grub added support for these long ago. Ay version of grub which understands lz4 also supports this. - Enabled rootpool tests in runfile but skipped by default in setup on Linux since they modify the rootpool. - bootfs_006_pos.ksh, striped pools are allowed as bootfs. OpenZFS-issue: https://www.illumos.org/issues/7404 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/55a424c Closes #5982
* OpenZFS 7629 - Fix for 7290 neglected to remove some escape sequencesBrian Behlendorf2017-04-073-133/+3
| | | | | | | | | | | | | | | Authored by: John Wren Kennedy <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: - Multiple changes in this commit were applied in c1d9abf. OpenZFS-issue: https://www.illumos.org/issues/7629 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/f5fb56d Closes #5980
* Correct shellcheck make recipeGiuseppe Di Natale2017-04-062-26/+22
| | | | | | | | | | | | Consolidated the shellcheck call in the make recipe down to a single call of shellcheck. Corrected script errors that have been skipped. Corrected script errors that have been introduced because make wasn't reporting any errors from shellcheck. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5976
* Skip xfstests on Amazon LinuxBrian Behlendorf2017-04-061-0/+2
| | | | | | | | | | | The ZFS enabled versions of xfstests fails to build cleanly on Amazon Linux. This issue should be resolved by rebasing the ZFS patches against the latest xfstests and pushing those patches upstream. This would allow us to use an unmodified xfstests. Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #5481 Closes #5977
* Fix coverity defects: CID 161288Giuseppe Di Natale2017-04-061-1/+1
| | | | | | | | | | CID 161288: Null pointer dereferences (REVERSE_INULL) Ensure physpath != NULL before the strcmp. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5974
* OpenZFS 7290 - ZFS test suite needs to control what utilities it can runJohn Wren Kennedy2017-04-06797-7460/+8040
| | | | | | | | | | | | | | | | | | | | | | | | | | | Authored by: John Wren Kennedy <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Gordon Ross <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> Porting Notes: - Utilities which aren't available under Linux have been removed. - Because of sudo's default secure path behavior PATH must be explicitly reset at the top of libtest.shlib. This avoids the need for all users to customize secure path on their system. - Updated ZoL infrastructure to manage constrained path - Updated all test cases - Check permissions for usergroup tests - When testing in-tree create links under bin/ - Update fault cleanup such that missing files during cleanup aren't fatal. - Configure su environment with constrained path OpenZFS-issue: https://www.illumos.org/issues/7290 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1d32ba6 Closes #5903
* Added auto-replace FMA test for the ZFS Test SuiteSydney Vanda2017-04-0511-114/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also included are updates to auto-online test Automated auto-replace test to go along with ZED FMA integration (PR 4673) auto-replace_001.pos works using a scsi_debug device (the only usable virtual device currently due to whole_disk var needing to be set) Functionality for automated FMA auto-replace test to work with scsi_debug devs: Some functionality/exceptions needed to be added for automation of auto-replace to work correctly. In the test an alias vdev_id rule is added for any scsi_debug device which sets the phys_path="scsidebug" after a udevadm trigger command. A symlink is created for the vdev_id.conf file (in /etc/zfs/ by default) to be used in-tree for the test suite (/var/tmp/zfs/vdev_id.conf). "./scripts/zfs-helpers.sh -i" needs to be run before fault tests in the ZTS (to use udev rules in-tree) Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Don Brady <[email protected]> Reviewed-by: David Quigley <[email protected]> Signed-off-by: Sydney Vanda <[email protected]> Closes #5944
* Accept raidz and mirror with similar redundancyHåkan Johansson2017-04-051-1/+43
| | | | | | | | Allow a pool to be created with both raidz and mirror members, without giving -f, as long as they have matching redundancy. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Haakan T Johansson <[email protected]> Closes #5915
* Fix regression in zfs_ereport_start()Don Brady2017-04-051-2/+3
| | | | | | | | | | | On 32-bit platforms spa_state is 32 bits without cast, and thus caused a NULL pointer dereference when treated as 64bit in var arg. Accidentally introduced by bcdb96a. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Nathaniel Clark <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #5966 Closes #5965
* Fix coverity defects: CID 161264Giuseppe Di Natale2017-04-051-1/+1
| | | | | | | | | | | | CID 161264: Uninitialized variables (UNINIT) In _zed_event_add_nvpair, when handling DATA_TYPE_UINT64, we should be using i64 throughout the entire case. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Don Brady <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5964
* OpenZFS 7885 - zpool list can report 16.0e for expandszSteven Hartland2017-04-051-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Authored by: Steven Hartland <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Gordon Ross <[email protected]> When a member of a RAIDZ has been replaced with a device smaller than the original, then the top level vdev can report its expand size as 16.0E. The reduced child asize causes the RAIDZ to have a vdev_asize lower than its vdev_max_asize which then results in an underflow during the calculation of the parents expand size. Fix this by updating the vdev_asize if it shrinks, which is already protected by a check against vdev_min_asize so should always be safe. Also for RAIDZ vdevs, ensure that the sum of their child vdev_min_asize is always greater than the parents vdev_min_size. Reviewed-off-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7885 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/bb0dbaa Closes #5963
* list -o props should be alloc,free not used,availTom Matthews2017-04-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Manpage suggests the zpool list properties include 'used' and 'available', when these are invalid property names. Use alloc and free in their place. ``` $ zpool list -o name,size,used 2>&1 |head -1 bad property list: invalid property 'used' $ zpool list -o name,size,avail 2>&1 |head -1 bad property list: invalid property 'avail' $ zpool list -o name,size,available 2>&1 |head -1 bad property list: invalid property 'available' $ zpool list -o name,size,alloc,free NAME SIZE ALLOC FREE apool 464M 203M 261M bpool 3.62T 1.97T 1.65T ``` Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Matthews <[email protected]> Closes #5959
* Additional Information for ZedletsN Clark2017-04-033-3/+19
| | | | | | | | | | | | | | | * Add ZPOOL pool state to zfs_post_common to allow differentiation between export and destroy by zedlets. * Add pool name as standard export This ensures pool name is exported to zedlets. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Don Brady <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Nathaniel Clark <[email protected]> Closes #5942
* Prevent commitcheck.sh from running twiceGiuseppe Di Natale2017-04-032-3/+5
| | | | | | | | | | A stray semicolon was causing commitcheck.sh to run twice when running make checkstyle. Updated regexes for matching tagged lines. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5952
* zfs_get_005_neg.ksh fix typosGeorge Melikov2017-04-031-2/+2
| | | | | | | | | `test_options_bookmark` function must have an `s` at the end. Reviewed-by: Marcel Telka <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Melikov <[email protected]> Closes #5957
* Commit message format in contributing guidelinesGiuseppe Di Natale2017-03-314-1/+219
| | | | | | | | | | Add the need to have a commit message with a specific format to the contributing guidelines. Provide a script to help enforce commit message style. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5943
* glibc 2.5 compat: use correct header for makedev() et al.Olaf Faaland2017-03-314-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In glibc 2.5, makedev(), major(), and minor() are defined in sys/sysmacros.h. They are also defined in types.h for backward compatability, but using these definitions triggers a compile warning. This breaks the ZFS build, as it builds with -Werror. autoconf email threads indicate these macros may be defined in sys/mkdev.h in some cases. This commit adds configure checks to detect where makedev() is defined: sys/sysmacros.h sys/mkdev.h It assumes major() and minor() are defined in the same place. The libspl types.h then includes sys/sysmacros.h (preferred) or sys/mkdev.h (2nd choice) if one of those defines makedev(). This is done before including the system types.h. An alternative would be to remove uses of major, minor, and makedev, instead comparing the st_dev returned from stat64. These configure checks would then be unnecessary. This change revealed that __NORETURN was being defined unnecessarily in libspl/include/sys/sysmacros.h. That definition is removed. The files in which __NORETURN are used all include types.h, and so all will get the definition provided by feature_tests.h Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #5945
* Fix add-o_ashift.ksh permissionsBrian Behlendorf2017-03-311-0/+0
| | | | | | | | | Test cases must be executable or they will be skipped. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: loli10K <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5947
* Remove dependency on linear ABDGvozden Neskovic2017-03-298-118/+147
| | | | | | | | | | | | | | | Wherever possible it's best to avoid depending on a linear ABD. Update the code accordingly in the following areas. - vdev_raidz - zio, zio_checksum - zfs_fm - change abd_alloc_for_io() to use abd_alloc() Reviewed-by: David Quigley <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Gvozden Neskovic <[email protected]> Closes #5668
* OpenZFS 7990 - libzfs: snapspec_cb() does not need to call zfs_strdup()Giuseppe Di Natale2017-03-281-7/+4
| | | | | | | | | | | | | Authored by: Marcel Telka <[email protected]> Reviewed by: Yuri Pankov <[email protected]> Reviewed by: Toomas Soome <[email protected]> Approved by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7990 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d8584ba Closes #5939
* Check ashift validity in 'zpool add'LOLi2017-03-288-9/+153
| | | | | | | | | | | | | df83110 added the ability to specify a custom "ashift" value from the command line in 'zpool add' and 'zpool attach'. This commit adds additional checks to the provided ashift to prevent invalid values from being used, which could result in disastrous consequences for the whole pool. Additionally provide ASHIFT_MAX and ASHIFT_MIN definitions in spa.h. Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #5878
* Fix wrong offset args in vdev_cache_writeChunwei Chen2017-03-281-2/+3
| | | | | | | | | | The offset arguments is wrong when changing to abd_copy_off in a6255b7 Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Gvozden Neskovic <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #5932 Closes #5936
* Fix "undefined reference to xdr_control" when building raidz_test cmdSen Haerens2017-03-281-0/+1
| | | | | | | Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: SenH <[email protected]> Closes #5933
* Disable rsend_009_posBrian Behlendorf2017-03-281-1/+1
| | | | | | | | | | | Test rsend_009_pos has been observed to fail pretty frequently when testing using a kmemleak enabled kernel. For the moment disable this test case until the underlying issue is resolved. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #5887 Closes #5934
* Update documentation for new parameter "zfs_qat_disable"wli52017-03-271-0/+13
| | | | | | | | | | Update documentation in zfs-module-parameters.5 for new parameter "zfs_qat_disable" which was introduced by #5846. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Weigang Li <[email protected]> Closes #5914
* Allow c99 when building ZFS in the kernel treeBrian Behlendorf2017-03-271-2/+5
| | | | | | | | | | Commit 4a5d7f82 enabled building c99 out of the kernel tree. However, when building as part of the kernel different Makefiles are used and -std=gnu99 must additionially be added there. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5919
* Fix 'zdb -o' segmentation faultLOLi2017-03-231-1/+1
| | | | | | | | | Fix a regression accidentally introduced by OpenZFS 7280 in ed828c0: since whether to accept NULL as a valid first parameter in strchr() is implementation specific we add an additional check to avoid crashing. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #5917
* Retry zfs_znode_alloc() in zfs_mknode()Brian Behlendorf2017-03-231-1/+12
| | | | | | | | | | | | | For historical reasons zfs_mknode() was written such that it could never fail. This poses a problem for Linux since zfs_znode_alloc() could potentually failure due to low memory. Handle this gracefully by retrying zfs_znode_alloc() until it succeeds, direct reclaim will eventually be able to allocate memory. Reviewed-by: George Melikov <[email protected]> Reviewed-by: loli10K <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5535 Closes #5908
* Fix undefined reference to `libzfs_fru_compare'Brian Behlendorf2017-03-233-7/+16
| | | | | | | | | | | | | | | Add trivial libzfs_fru_compare() function which can be used when HAVE_LIBTOPO is not defined. The only caller is find_vdev() and this function should never be reached because search_fru must be NULL unless HAVE_LIBTOPO is defined. Rename _HAS_FMD_TOPO to existing HAVE_LIBTOPO which was originally added for this purpose. This macro will never be defined. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5402 Closes #5909
* OpenZFS 3821 - Race in rollback, zil close, and zil flushGeorge Wilson2017-03-233-8/+70
| | | | | | | | | | | | | | | Authored by: George Wilson <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Andriy Gapon <[email protected]> Approved by: Richard Lowe <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/3821 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/43297f9 Closes #5905