Compare commits

...

41 Commits

Author SHA1 Message Date
Tony Hutter 63b88f7e22 Tag zfs-0.8.1
META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2019-06-14 09:43:18 -07:00
Alexander Motin 72888812b0 Fix comparison signedness in arc_is_overflowing()
When ARC size is very small, aggsum_lower_bound(&arc_size) may return
negative values, that due to unsigned comparison caused delays, waiting
for arc_adjust() to "fix" it by calling aggsum_value(&arc_size).  Use
of signed comparison there fixes the problem.

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Closes #8873
2019-06-11 10:45:23 -07:00
Tom Caputi 581c77e725 Fix incorrect error message for raw receive
This patch fixes an incorrect error message that comes up when
doing a non-forcing, raw, incremental receive into a dataset
that has a newer snapshot than the "from" snapshot. In this
case, the current code prints a confusing message about an IVset
guid mismatch.

This functionality is supported by non-raw receives as an
undocumented feature, but was never supported by the raw receive
code. If this is desired in the future, we can probably figure
out a way to make it work.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Issue #8758
Closes #8863
2019-06-11 10:45:17 -07:00
Eli Schwartz ba505f90d8 arc_summary: prefer python3 version and install when there is no python
This matches the behavior of other python scripts, such as arcstat and
dbufstat, which are always installed but whose install-exec-hook actions
will simply touch up the shebang if a python interpreter was configured
*and* that interpreter is a python2 interpreter.

Fixes installation in a minimal build chroot without python available.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@freqlabs.com>
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Closes #8851
2019-06-11 10:45:02 -07:00
Samuel VERSCHELDE eaa21b2349 Fix %post and %postun generation in kmodtool
During zfs-kmod RPM build, $(uname -r) gets unintentionally evaluated on
the build host, once and for all. It should be evaluated during the
execution of the scriptlets on the installation host. Escaping the $
character avoids evaluating it during build.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
Closes #8866
2019-06-11 10:44:54 -07:00
Tom Caputi 8dc8bbde6e Reinstate raw receive check when truncating
This patch re-adds a check that was removed in 369aa50. The check
confirms that a raw receive is not occuring before truncating an
object's dn_maxblkid. At the time, it was believed that all cases
that would hit this code path would be handled in other places,
but that was not the case.

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8852 
Closes #8857
2019-06-07 12:45:40 -07:00
Garrett Fields 9fd95a2f1b If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
Closes #8356
2019-06-07 12:45:40 -07:00
Tom Caputi 35050ef39e Fix integer overflow of ZTOI(zp)->i_generation
The ZFS on-disk format stores each inode's generation ID as a 64
bit number on disk and in-core. However, the Linux kernel's inode
is only a 32 bit number. In most places, the code handles this
correctly, but the cast is missing in zfs_rezget(). For many pools,
this isn't an issue since the generation ID is computed as the
current txg when the inode is created and many pools don't have
more than 2^32 txgs.

For the pools that have more txgs, this issue causes any inode with
a high enough generation number to report IO errors after a call to
"zfs rollback" while holding the file or directory open. This patch
simply adds the missing cast.

Reviewed-by: Alek Pinchuk <apinchuk@datto.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8858
2019-06-07 12:45:40 -07:00
Don Brady 5108d27aec hkdf_test binary should only have one icp instance
The build for test binary hkdf_test was linking both against libicp 
and libzpool. This results in two instances of libicp inside the 
binary but the call to icp_init() only initializes one of them!

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes #8850
2019-06-07 12:45:40 -07:00
Peter Wirdemo 02010e9c2c Fixed a small typo in man/man1/raidz_test.1
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Peter Wirdemo <peter.wirdemo@gmail.com>
Closes #8855
2019-06-07 12:45:40 -07:00
Torsten Wörtwein a0bf24952d Allow TRIM_UNUSED_KSYM when build as a builtin-module
If ZFS is built with enable_linux_builtin, it seems to be possible
to compile the kernel with TRIM_UNUSED_KSYM.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Torsten Wörtwein <twoertwein@gmail.com>
Closes #8820
2019-06-07 12:45:40 -07:00
Ryan Moeller d6920fb996 Make Python detection optional and more portable
Previously, --without-python would cause ./configure to fail. Now it is
able to proceed, and the Python scripts will not be built.

Use portable parameter expansion matching instead of nonstandard
substring matching to detect the Python version.  This test is
duplicated in several places, so define a function for it.

Don't assume the full path to binaries, since different platforms do
install things in different places.  Use AC_CHECK_PROGS instead.

When building without Python, also build without pyzfs.

Sponsored by: iXsystems, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Ryan Moeller <ryan@freqlabs.com>
Closes #8809 
Closes #8731
2019-06-07 12:45:40 -07:00
DeHackEd 58b2de6420 Wait in 'S' state when send/recv pipe is blocking
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes #8733 
Closes #8752
2019-06-07 12:45:40 -07:00
TulsiJain 11ad06d1d8 Make zfs_async_block_max_blocks handle zero correctly
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: TulsiJain <tulsi.jain@delphix.com>
Closes #8829
Closes #8289
2019-06-07 12:45:40 -07:00
Brian Behlendorf 4f8eef29e0 Revert "Report holes when there are only metadata changes"
This reverts commit ec4f9b8f30 which introduced a narrow race which
can lead to lseek(, SEEK_DATA) incorrectly returning ENXIO.  Resolve
the issue by revering this change to restore the previous behavior
which depends solely on checking the dirty list.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8816 
Closes #8834
2019-06-07 12:45:40 -07:00
Tomohiro Kusumi 94866d8309 Add link count test for root inode
Add tests for
97aa3ba44("Fix link count of root inode when snapdir is visible")
as suggested in #8727.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #8732
2019-06-07 12:45:40 -07:00
Brian Behlendorf a1eaf0dde0 Exclude log device ashift from normal class
When opening a log device during import its allocation bias will
not yet have been set by vdev_load().  This results in the log
device's ashift being incorrectly applied to the maximum ashift
of the vdevs in the normal class.  Which in turn prevents the
removal of any top-level devices due to the ashift check in the
spa_vdev_remove_top_check() function.

This issue is resolved by including vdev_islog in the check since
it will be set correctly during vdev_open().

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8735
2019-06-07 12:45:40 -07:00
madz 580256045b Fix integer overflow in get_next_chunk()
dn->dn_datablksz type is uint32_t and need to be casted to uint64_t
to avoid an overflow when the record size is greater than 4 MiB.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olivier Mazouffre <olivier.mazouffre@ims-bordeaux.fr>
Closes #8778 
Closes #8797
2019-06-07 12:45:40 -07:00
loli10K aaf3b30dcf Double-free of encryption wrapping key due to invalid pool properties
This commits fixes a double-free in zfs_ioc_pool_create() triggered by
specifying an unsupported combination of properties when creating a pool
with encryption enabled.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8791
2019-06-07 12:45:40 -07:00
Stoiko Ivanov 27b446f799 tests: fix cosmetic permission issues during make install
files in dist_*_SCRIPTS get installed with 0755, those in dist_*_DATA
with 0644. This commit moves all .kshlib, .shlib and .cfg files in the
testsuite to dist_pkgdata_DATA, and removes the shebang from
zpool_import.kshlib.

This ensures that the files are installed with appropriate permissions
and silences some warnings from lintian

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #8803
2019-06-07 12:45:40 -07:00
Stoiko Ivanov 0c6206e7f1 test-runner.py: change shebang to python3
In commit 6e72a5b9b6 python scripts which
work with python2 and python3 changed the shebang from /usr/bin/python
to /usr/bin/python3. This gets adapted by the build-system on systems
which don't provide python3.
This commit changes test-runner.py to also use /usr/bin/python3,
enabling the change during buildtime and fixing a minor lintian issue
for those Debian packages, which depend on a specific python version
(python3/python2).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #8803
2019-06-07 12:45:40 -07:00
loli10K 51de7ccb42 Endless loop in zpool_do_remove() on platforms with unsigned char
On systems where "char" is an unsigned type the value returned by
getopt() will never be negative (-1), leading to an endless loop:
this issue prevents both 'zpool remove' and 'zstreamdump' for
working on some systems.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8789
2019-06-07 12:45:40 -07:00
Tom Caputi 69ae34076f Fix embedded bp accounting in count_block()
Currently, count_block() does not correctly account for the
possibility that the bp that is passed to it could be embedded.
These blocks shouldn't be counted since the work of scanning
these blocks in already handled when the containing block is
scanned. This patch simply resolves this issue by returning
early in this case.

Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Authored-by: Bill Sommerfeld <sommerfeld@alum.mit.edu>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8800 
Closes #8766
2019-06-07 12:39:13 -07:00
Tom Caputi b746c397e3 Disable parallel processing for 'zfs mount -l'
Currently, 'zfs mount -a' will always attempt to parallelize
work related to mounting as best it can. Unfortunately, when
the user passes the '-l' option to load keys, this causes
all threads to prompt the user for their keys at once,
resulting in a confusing and racy user experience. This patch
simply disables parallel mounting when using the '-l' flag.

Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8762 
Closes #8811
2019-06-07 12:39:13 -07:00
Tomohiro Kusumi 2fb37bcadd Linux 5.2 compat: Directly call wait_on_page_bit()
wait_on_page_writeback() was made GPL only in torvalds/linux@19343b5bdd.

Directly call wait_on_page_bit() without using wait_on_page_writeback()
interface, given zfs_putpage() is the only caller for now.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #8794
2019-06-07 12:39:13 -07:00
Tomohiro Kusumi a727f69e52 Linux 5.2 compat: Fix config/kernel-shrink.m4 test failure
"whether ->count_objects callback exists" test failed with
"error: error" message for using an incomplete function shrinker_cb().

This is caused by torvalds/linux@83da1bed86. It's configurable,
but we would want to be able to compile with default kbuild setting.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #8776
2019-06-07 12:39:13 -07:00
Tomohiro Kusumi 8ec352be1f Linux 5.2 compat: Remove config/kernel-set-fs-pwd.m4
This failed on 5.2-rc1 with "error: unknown" message, for set_fs_pwd()
not being visible in both const and non-const tests.

This is caused by torvalds/linux@83da1bed86. It's configurable,
but we would want to be able to compile with default kbuild setting.

set_fs_pwd() has never been exported with exception of some distro
kernels, and set_fs_pwd() wasn't used in ZoL to begin with. The test
result was used for a spl function vn_set_fs_pwd().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
Closes #8777
2019-06-07 12:39:13 -07:00
loli10K df717bb835 zpool: status -t is not documented in help message
This commit adds the undocumented "-t" option to zpool(8) help message.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8782
2019-06-07 12:39:13 -07:00
loli10K e0b3689ed5 zfs-tests: fix warnings when packaging some .shlib files
This change prevents the following warning when packaging some zfs-tests
files:

   *** WARNING: ./usr/src/zfs-0.8.0/tests/zfs-tests/include/zpool_script.shlib
   is executable but has empty or no shebang, removing executable bit

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8787
2019-06-07 12:39:13 -07:00
loli10K 438275c9a0 VERIFY3P() message is missing a space character
This commit just reintroduces a [space] character inadvertently removed
in a887d653.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8786
2019-06-07 12:39:13 -07:00
loli10K 8cfa6d4a1c zfs-tests: verify zfs(8) and zpool(8) help message is under 80 columns
This commit updates the ZFS Test Suite to detect incorrect wrapping of
both zfs(8) and zpool(8) help message

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8785
2019-06-07 12:39:13 -07:00
loli10K ad0157ec91 zfs: don't pretty-print objsetid property
The objsetid property, while being stored as a number, is a dataset
identifier and should not be pretty-printed.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8784
2019-06-07 12:39:13 -07:00
loli10K cd75d5f710 zfs: missing newline character in zfs_do_channel_program() error message
This commit simply adds a missing newline ("\n") character to the error
message printed by the zfs command when the provided pool parameter
can't be found.

Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8783
2019-06-07 12:39:13 -07:00
siv0 c6bbacebc8 Fix ksh-path for random_readwrite_fixed.ksh
The test in zfs-tests/tests/perf/regression/random_readwrite_fixed.ksh
is the only file to use /usr/bin/ksh in the shebang.
Change it to /bin/ksh for consistency.

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #8779
2019-06-07 12:39:13 -07:00
Tomohiro Kusumi 4d7cb872e8 Linux 2.6.39 compat: Test if kstrtoul() exists
kstrtoul() exists only after torvalds/linux@33ee3b2e2e in 2.6.39.
Use strict_strtoul() if kstrtoul() doesn't exist.
Note that strict_strtoul() has existed as an alias for kstrtoul()
for a while, but removed in torvalds/linux@3db2e9cdc0.

It looks like RHEL6 (2.6.32 based) has backported kstrtoul(),
and this caused build CI to pass compilation test.
It should fail on vanilla < 2.6.39 kernels or distro kernels without
backport as reported in #8760.

--
 # grep "kstrtoul(" /lib/modules/2.6.32-754.12.1.el6.x86_64/build/ \
 include/linux/kernel.h >/dev/null
 # echo $?
 0

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8760 
Closes #8761
2019-06-07 12:39:13 -07:00
loli10K f91e7e6284 Device removal panics on 32-bit systems
The issue is caused by an incorrect usage of the sizeof() operator
in vdev_obsolete_sm_object(): on 64-bit systems this is not an issue
since both "uint64_t" and "uint64_t*" are 8 bytes in size. However on
32-bit systems pointers are 4 bytes long which is not supported by
zap_lookup_impl(). Trying to remove a top-level vdev on a 32-bit system
will cause the following failure:

VERIFY3(0 == vdev_obsolete_sm_object(vd, &obsolete_sm_object)) failed (0 == 22)
PANIC at vdev_indirect.c:833:vdev_indirect_sync_obsolete()
Showing stack for process 1315
CPU: 6 PID: 1315 Comm: txg_sync Tainted: P           OE   4.4.69+ #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
 c1abc6e7 0ae10898 00000286 d4ac3bc0 c14397bc da4cd7d8 d4ac3bf0 d4ac3bd0
 d790e7ce d7911cc1 00000523 d4ac3d00 d790e7d7 d7911ce4 da4cd7d8 00000341
 da4ce664 da4cd8c0 da33fa6e 49524556 28335946 3d3d2030 65647620 626f5f76
Call Trace:
 [<>] dump_stack+0x58/0x7c
 [<>] spl_dumpstack+0x23/0x27 [spl]
 [<>] spl_panic.cold.0+0x5/0x41 [spl]
 [<>] ? dbuf_rele+0x3e/0x90 [zfs]
 [<>] ? zap_lookup_norm+0xbe/0xe0 [zfs]
 [<>] ? zap_lookup+0x57/0x70 [zfs]
 [<>] ? vdev_obsolete_sm_object+0x102/0x12b [zfs]
 [<>] vdev_indirect_sync_obsolete+0x3e1/0x64d [zfs]
 [<>] ? txg_verify+0x1d/0x160 [zfs]
 [<>] ? dmu_tx_create_dd+0x80/0xc0 [zfs]
 [<>] vdev_sync+0xbf/0x550 [zfs]
 [<>] ? mutex_lock+0x10/0x30
 [<>] ? txg_list_remove+0x9f/0x1a0 [zfs]
 [<>] ? zap_contains+0x4d/0x70 [zfs]
 [<>] spa_sync+0x9f1/0x1b10 [zfs]
 ...
 [<>] ? kthread_stop+0x110/0x110

This commit simply corrects the "integer_size" parameter used to lookup
the vdev's ZAP object.

Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8790
2019-06-07 12:39:13 -07:00
loli10K abe267f677 zpool: trim -p is not a valid option
This commit removes the documented but not handled "-p" option from
zpool(8) help message.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8781
2019-06-07 12:39:13 -07:00
loli10K cc434dcf45 Fix coverity defects: CID 186143
CID 186143: Memory - illegal accesses (USE_AFTER_FREE)

This patch fixes an use-after-free in spa_import_progress_destroy()
moving the kmem_free() call at the end of the function.

Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8788
2019-06-07 12:39:13 -07:00
Igor K e2e7b0a2cd Rename reservation tests from *.sh to *.ksh
Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Igor Kozhukhov <igor@dilos.org>
Closes #8729
2019-06-07 12:39:13 -07:00
Richard Elling 78fac8d925 Fix kstat state update during pool transition
When reading kstats, the health (aka state) of the pool is stored into
/proc/spl/kstat/zfs/POOLNAME/state via spa_state_to_name().
However, during import/export there is a case where the spa exists,
but the root vdev does not exist. This fix checks that case and sets
the state to "TRANSITIONING"

Unfortunately, it is not easy to reproduce a test for this. It was
detected randomly during ZTS runs while kstats were also being sampled
regularly. After this change, further testing did not trip on the case
and the TRANSITIONING state was collected at least once by the kstats.

For posterity, the backtrace prior to this fix is:
[Mon May 13 17:21:00 2019] RIP: 0010:spa_state_to_name+0x10/0xb0 [zfs]
...
Mon May 13 17:21:00 2019] Call Trace:
[Mon May 13 17:21:00 2019]  spa_state_data+0x1a/0x40 [zfs]
[Mon May 13 17:21:00 2019]  kstat_seq_show+0x117/0x440 [spl]
[Mon May 13 17:21:00 2019]  seq_read+0xe5/0x430
[Mon May 13 17:21:00 2019]  proc_reg_read+0x45/0x70
[Mon May 13 17:21:00 2019]  __vfs_read+0x1b/0x40
[Mon May 13 17:21:00 2019]  vfs_read+0x8e/0x130
[Mon May 13 17:21:00 2019]  SyS_read+0x55/0xc0
[Mon May 13 17:21:00 2019]  ? SyS_fcntl+0x5d/0xb0
[Mon May 13 17:21:00 2019]  do_syscall_64+0x73/0x130
[Mon May 13 17:21:00 2019]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Richard Elling <Richard.Elling@RichardElling.com>
Closes #8746
2019-05-23 14:28:53 -07:00
Brian Behlendorf bff2361aeb Linux 5.2 compat: rw_tryupgrade()
Commit torvalds/linux@46ad0840b has removed the architecture specific
rwsem source and headers leaving only the generic version.  As part
of this change the RWSEM_ACTIVE_READ_BIAS and RWSEM_ACTIVE_WRITE_BIAS
macros were moved to the private kernel/locking/rwsem.h header.
This results in a build failure because these macros were required
to implement the rw_tryupgrade() compatibility function.

In practice, this isn't a major problem because there are only a
few consumers of rw_tryupgrade() and because consumers of rw_tryupgrade
should be written to retry using rw_enter(RW_WRITER).

After auditing all of the callers only dmu_zfetch() was determined
not to perform a retry.  It has been updated in this commit to
resolve this issue.

That said, the rw_tryupgrade() functionality should be considered
for possible removal in a future release due to the difficultly
in supporting the interface.

Reviewed-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8730
2019-05-23 13:46:33 -07:00
75 changed files with 385 additions and 207 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
Meta: 1
Name: zfs
Branch: 1.0
Version: 0.8.0
Version: 0.8.1
Release: 1
Release-Tags: relext
License: CDDL
+2 -1
View File
@@ -111,9 +111,10 @@ mancheck:
fi
testscheck:
@find ${top_srcdir}/tests/zfs-tests/tests -type f \
@find ${top_srcdir}/tests/zfs-tests -type f \
\( -name '*.ksh' -not -executable \) -o \
\( -name '*.kshlib' -executable \) -o \
\( -name '*.shlib' -executable \) -o \
\( -name '*.cfg' -executable \) | \
xargs -r stat -c '%A %n' | \
awk '{c++; print} END {if(c>0) exit 1}'
+7 -2
View File
@@ -1,3 +1,8 @@
SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest
SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed
SUBDIRS += arc_summary raidz_test zgenhostid
SUBDIRS += fsck_zfs vdev_id raidz_test zgenhostid
if USING_PYTHON
SUBDIRS += arcstat arc_summary dbufstat
endif
SUBDIRS += mount_zfs zed zvol_id
+1 -3
View File
@@ -4,9 +4,7 @@ if USING_PYTHON_2
dist_bin_SCRIPTS = arc_summary2
install-exec-hook:
mv $(DESTDIR)$(bindir)/arc_summary2 $(DESTDIR)$(bindir)/arc_summary
endif
if USING_PYTHON_3
else
dist_bin_SCRIPTS = arc_summary3
install-exec-hook:
mv $(DESTDIR)$(bindir)/arc_summary3 $(DESTDIR)$(bindir)/arc_summary
+9 -5
View File
@@ -28,6 +28,7 @@
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
* Copyright 2016 Nexenta Systems, Inc.
* Copyright (c) 2019 Datto Inc.
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
*/
#include <assert.h>
@@ -2238,7 +2239,7 @@ zfs_do_upgrade(int argc, char **argv)
boolean_t showversions = B_FALSE;
int ret = 0;
upgrade_cbdata_t cb = { 0 };
signed char c;
int c;
int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
/* check options */
@@ -3932,7 +3933,7 @@ static int
zfs_do_snapshot(int argc, char **argv)
{
int ret = 0;
signed char c;
int c;
nvlist_t *props;
snap_cbdata_t sd = { 0 };
boolean_t multiple_snaps = B_FALSE;
@@ -6621,10 +6622,13 @@ share_mount(int op, int argc, char **argv)
/*
* libshare isn't mt-safe, so only do the operation in parallel
* if we're mounting.
* if we're mounting. Additionally, the key-loading option must
* be serialized so that we can prompt the user for their keys
* in a consistent manner.
*/
zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used,
share_mount_one_cb, &share_mount_state, op == OP_MOUNT);
share_mount_one_cb, &share_mount_state,
op == OP_MOUNT && !(flags & MS_CRYPT));
ret = share_mount_state.sm_status;
for (int i = 0; i < cb.cb_used; i++)
@@ -7522,7 +7526,7 @@ zfs_do_channel_program(int argc, char **argv)
}
if ((zhp = zpool_open(g_zfs, poolname)) == NULL) {
(void) fprintf(stderr, gettext("cannot open pool '%s'"),
(void) fprintf(stderr, gettext("cannot open pool '%s'\n"),
poolname);
if (fd != 0)
(void) close(fd);
+4 -3
View File
@@ -30,6 +30,7 @@
* Copyright (c) 2017 Datto Inc.
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
* Copyright (c) 2017, Intel Corporation.
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
*/
#include <assert.h>
@@ -384,11 +385,11 @@ get_usage(zpool_help_t idx)
case HELP_RESILVER:
return (gettext("\tresilver <pool> ...\n"));
case HELP_TRIM:
return (gettext("\ttrim [-dp] [-r <rate>] [-c | -s] <pool> "
return (gettext("\ttrim [-d] [-r <rate>] [-c | -s] <pool> "
"[<device> ...]\n"));
case HELP_STATUS:
return (gettext("\tstatus [-c [script1,script2,...]] "
"[-igLpPsvxD] [-T d|u] [pool] ... \n"
"[-igLpPstvxD] [-T d|u] [pool] ... \n"
"\t [interval [count]]\n"));
case HELP_UPGRADE:
return (gettext("\tupgrade\n"
@@ -972,7 +973,7 @@ zpool_do_remove(int argc, char **argv)
int i, ret = 0;
zpool_handle_t *zhp = NULL;
boolean_t stop = B_FALSE;
char c;
int c;
boolean_t noop = B_FALSE;
boolean_t parsable = B_FALSE;
+1 -1
View File
@@ -237,7 +237,7 @@ main(int argc, char *argv[])
struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
struct drr_object_range *drror = &thedrr.drr_u.drr_object_range;
struct drr_checksum *drrc = &thedrr.drr_u.drr_checksum;
char c;
int c;
boolean_t verbose = B_FALSE;
boolean_t very_verbose = B_FALSE;
boolean_t first = B_TRUE;
+24 -19
View File
@@ -12,6 +12,17 @@ AC_DEFUN([ZFS_AC_PYTHON_VERSION], [
])
])
dnl #
dnl # ZFS_AC_PYTHON_VERSION_IS_2
dnl # ZFS_AC_PYTHON_VERSION_IS_3
dnl #
dnl # Tests if the $PYTHON_VERSION matches 2.x or 3.x.
dnl #
AC_DEFUN([ZFS_AC_PYTHON_VERSION_IS_2],
[test "${PYTHON_VERSION%%\.*}" = "2"])
AC_DEFUN([ZFS_AC_PYTHON_VERSION_IS_3],
[test "${PYTHON_VERSION%%\.*}" = "3"])
dnl #
dnl # ZFS_AC_PYTHON_MODULE(module_name, [action-if-true], [action-if-false])
dnl #
@@ -46,42 +57,36 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
[with_python=check])
AS_CASE([$with_python],
[check],
[AS_IF([test -x /usr/bin/python3],
[PYTHON="python3"],
[AS_IF([test -x /usr/bin/python2],
[PYTHON="python2"],
[PYTHON=""]
)]
)],
[check], [AC_CHECK_PROGS([PYTHON], [python3 python2], [:])],
[2*], [PYTHON="python${with_python}"],
[*python2*], [PYTHON="${with_python}"],
[3*], [PYTHON="python${with_python}"],
[*python3*], [PYTHON="${with_python}"],
[no], [PYTHON=""],
[no], [PYTHON=":"],
[AC_MSG_ERROR([Unknown --with-python value '$with_python'])]
)
AS_IF([$PYTHON --version >/dev/null 2>&1], [ /bin/true ], [
AC_MSG_ERROR([Cannot find $PYTHON in your system path])
AS_IF([test $PYTHON != :], [
AS_IF([$PYTHON --version >/dev/null 2>&1],
[AM_PATH_PYTHON([2.6], [], [:])],
[AC_MSG_ERROR([Cannot find $PYTHON in your system path])]
)
])
AM_PATH_PYTHON([2.6], [], [:])
AM_CONDITIONAL([USING_PYTHON], [test "$PYTHON" != :])
AM_CONDITIONAL([USING_PYTHON_2], [test "${PYTHON_VERSION:0:2}" = "2."])
AM_CONDITIONAL([USING_PYTHON_3], [test "${PYTHON_VERSION:0:2}" = "3."])
AM_CONDITIONAL([USING_PYTHON_2], [ZFS_AC_PYTHON_VERSION_IS_2])
AM_CONDITIONAL([USING_PYTHON_3], [ZFS_AC_PYTHON_VERSION_IS_3])
dnl #
dnl # Minimum supported Python versions for utilities:
dnl # Python 2.6.x, or Python 3.4.x
dnl #
AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [
ZFS_AC_PYTHON_VERSION([>= '2.6'], [ /bin/true ],
AS_IF([ZFS_AC_PYTHON_VERSION_IS_2], [
ZFS_AC_PYTHON_VERSION([>= '2.6'], [ true ],
[AC_MSG_ERROR("Python >= 2.6.x is not available")])
])
AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [
ZFS_AC_PYTHON_VERSION([>= '3.4'], [ /bin/true ],
AS_IF([ZFS_AC_PYTHON_VERSION_IS_3], [
ZFS_AC_PYTHON_VERSION([>= '3.4'], [ true ],
[AC_MSG_ERROR("Python >= 3.4.x is not available")])
])
+8 -3
View File
@@ -18,7 +18,12 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
DEFINE_PYZFS='--without pyzfs'
])
], [
DEFINE_PYZFS=''
AS_IF([test $PYTHON != :], [
DEFINE_PYZFS=''
], [
enable_pyzfs=no
DEFINE_PYZFS='--without pyzfs'
])
])
AC_SUBST(DEFINE_PYZFS)
@@ -26,10 +31,10 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
dnl # Require python-devel libraries
dnl #
AS_IF([test "x$enable_pyzfs" = xcheck -o "x$enable_pyzfs" = xyes], [
AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [
AS_IF([ZFS_AC_PYTHON_VERSION_IS_2], [
PYTHON_REQUIRED_VERSION=">= '2.7.0'"
], [
AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [
AS_IF([ZFS_AC_PYTHON_VERSION_IS_3], [
PYTHON_REQUIRED_VERSION=">= '3.4.0'"
], [
AC_MSG_ERROR("Python $PYTHON_VERSION unknown")
+21
View File
@@ -0,0 +1,21 @@
dnl #
dnl # 2.6.39 API change
dnl #
dnl # 33ee3b2e2eb9 kstrto*: converting strings to integers done (hopefully) right
dnl #
dnl # If kstrtoul() doesn't exist, fallback to use strict_strtoul() which has
dnl # existed since 2.6.25.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_KSTRTOUL], [
AC_MSG_CHECKING([whether kstrtoul() exists])
ZFS_LINUX_TRY_COMPILE([
#include <linux/kernel.h>
],[
int ret __attribute__ ((unused)) = kstrtoul(NULL, 10, NULL);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_KSTRTOUL, 1, [kstrtoul() exists])
],[
AC_MSG_RESULT(no)
])
])
-39
View File
@@ -1,39 +0,0 @@
dnl #
dnl # 3.9 API change
dnl # set_fs_pwd takes const struct path *
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SET_FS_PWD_WITH_CONST],
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
[AC_MSG_CHECKING([whether set_fs_pwd() requires const struct path *])
ZFS_LINUX_TRY_COMPILE([
#include <linux/spinlock.h>
#include <linux/fs_struct.h>
#include <linux/path.h>
void (*const set_fs_pwd_func)
(struct fs_struct *, const struct path *)
= set_fs_pwd;
],[
return 0;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SET_FS_PWD_WITH_CONST, 1,
[set_fs_pwd() needs const path *])
],[
ZFS_LINUX_TRY_COMPILE([
#include <linux/spinlock.h>
#include <linux/fs_struct.h>
#include <linux/path.h>
void (*const set_fs_pwd_func)
(struct fs_struct *, struct path *)
= set_fs_pwd;
],[
return 0;
],[
AC_MSG_RESULT(no)
],[
AC_MSG_ERROR(unknown)
])
])
EXTRA_KCFLAGS="$tmp_flags"
])
+15 -7
View File
@@ -144,7 +144,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h>
int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
int shrinker_cb(int nr_to_scan, gfp_t gfp_mask) {
return 0;
}
],[
struct shrinker cache_shrinker = {
.shrink = shrinker_cb,
@@ -166,8 +168,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h>
int shrinker_cb(struct shrinker *, int nr_to_scan,
gfp_t gfp_mask);
int shrinker_cb(struct shrinker *shrink, int nr_to_scan,
gfp_t gfp_mask) {
return 0;
}
],[
struct shrinker cache_shrinker = {
.shrink = shrinker_cb,
@@ -190,8 +194,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
ZFS_LINUX_TRY_COMPILE([
#include <linux/mm.h>
int shrinker_cb(struct shrinker *,
struct shrink_control *sc);
int shrinker_cb(struct shrinker *shrink,
struct shrink_control *sc) {
return 0;
}
],[
struct shrinker cache_shrinker = {
.shrink = shrinker_cb,
@@ -215,8 +221,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
#include <linux/mm.h>
unsigned long shrinker_cb(
struct shrinker *,
struct shrink_control *sc);
struct shrinker *shrink,
struct shrink_control *sc) {
return 0;
}
],[
struct shrinker cache_shrinker = {
.count_objects = shrinker_cb,
+4 -3
View File
@@ -11,7 +11,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_CONFIG
ZFS_AC_KERNEL_CTL_NAME
ZFS_AC_KERNEL_PDE_DATA
ZFS_AC_KERNEL_SET_FS_PWD_WITH_CONST
ZFS_AC_KERNEL_2ARGS_VFS_FSYNC
ZFS_AC_KERNEL_FS_STRUCT_SPINLOCK
ZFS_AC_KERNEL_KUIDGID_T
@@ -167,6 +166,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_TOTALHIGH_PAGES
ZFS_AC_KERNEL_BLK_QUEUE_DISCARD
ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE
ZFS_AC_KERNEL_KSTRTOUL
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
KERNEL_MAKE="$KERNEL_MAKE O=$LINUX_OBJ"
@@ -529,10 +529,11 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS], [
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_ERROR([
AS_IF([test "x$enable_linux_builtin" != xyes], [
AC_MSG_ERROR([
*** This kernel has unused symbols trimming enabled, please disable.
*** Rebuild the kernel with CONFIG_TRIM_UNUSED_KSYMS=n set.])
])
])])
])
dnl #
+3 -1
View File
@@ -878,7 +878,9 @@ mountroot()
pool="$("${ZPOOL}" get name,guid -o name,value -H | \
awk -v pool="${ZFS_RPOOL}" '$2 == pool { print $1 }')"
if [ -n "$pool" ]; then
ZFS_BOOTFS="${pool}/${ZFS_BOOTFS#*/}"
# If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
ZFS_BOOTFS=$(echo "$ZFS_BOOTFS" | \
sed -e "s/$("${ZPOOL}" get guid -o value "$pool" -H)/$pool/g")
ZFS_RPOOL="${pool}"
fi
+1 -1
View File
@@ -102,7 +102,7 @@ void spl_dumpstack(void);
if (!(_verify3_left OP _verify3_right)) \
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
"VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
"failed (%px" #OP " %px)\n", \
"failed (%px " #OP " %px)\n", \
(void *) (_verify3_left), \
(void *) (_verify3_right)); \
} while (0)
+1 -1
View File
@@ -36,7 +36,7 @@
#elif defined(CONFIG_RWSEM_GENERIC_SPINLOCK)
#define SPL_RWSEM_SINGLE_READER_VALUE (1)
#define SPL_RWSEM_SINGLE_WRITER_VALUE (-1)
#else
#elif defined(RWSEM_ACTIVE_MASK)
#define SPL_RWSEM_SINGLE_READER_VALUE (RWSEM_ACTIVE_READ_BIAS)
#define SPL_RWSEM_SINGLE_WRITER_VALUE (RWSEM_ACTIVE_WRITE_BIAS)
#endif
+4
View File
@@ -28,4 +28,8 @@
#define bcopy(src, dest, size) memmove(dest, src, size)
#define bcmp(src, dest, size) memcmp((src), (dest), (size_t)(size))
#ifndef HAVE_KSTRTOUL
#define kstrtoul strict_strtoul
#endif
#endif /* _SPL_SYS_STRINGS_H */
+4 -1
View File
@@ -31,6 +31,7 @@
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
* Copyright 2017-2018 RackTop Systems.
* Copyright (c) 2019 Datto Inc.
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
*/
#include <ctype.h>
@@ -2969,8 +2970,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
case ZFS_PROP_GUID:
case ZFS_PROP_CREATETXG:
case ZFS_PROP_OBJSETID:
/*
* GUIDs are stored as numbers, but they are identifiers.
* These properties are stored as numbers, but they are
* identifiers.
* We don't want them to be pretty printed, because pretty
* printing mangles the ID into a truncated and useless value.
*/
+1 -1
View File
@@ -25,7 +25,7 @@
.TH raidz_test 1 "2016" "ZFS on Linux" "User Commands"
.SH NAME
\fBraidz_test\fR \- raidz implementation verification and bencmarking tool
\fBraidz_test\fR \- raidz implementation verification and benchmarking tool
.SH SYNOPSIS
.LP
.BI "raidz_test <options>"
+9 -1
View File
@@ -85,7 +85,8 @@ __rwsem_tryupgrade(struct rw_semaphore *rwsem)
spl_rwsem_unlock_irqrestore(&rwsem->wait_lock, flags);
return (ret);
}
#elif defined(HAVE_RWSEM_ATOMIC_LONG_COUNT)
#elif defined(RWSEM_ACTIVE_MASK)
#if defined(HAVE_RWSEM_ATOMIC_LONG_COUNT)
static int
__rwsem_tryupgrade(struct rw_semaphore *rwsem)
{
@@ -104,6 +105,13 @@ __rwsem_tryupgrade(struct rw_semaphore *rwsem)
return (val == SPL_RWSEM_SINGLE_READER_VALUE);
}
#endif
#else
static int
__rwsem_tryupgrade(struct rw_semaphore *rwsem)
{
return (0);
}
#endif
int
rwsem_tryupgrade(struct rw_semaphore *rwsem)
-4
View File
@@ -643,11 +643,7 @@ EXPORT_SYMBOL(areleasef);
static void
#ifdef HAVE_SET_FS_PWD_WITH_CONST
vn_set_fs_pwd(struct fs_struct *fs, const struct path *path)
#else
vn_set_fs_pwd(struct fs_struct *fs, struct path *path)
#endif /* HAVE_SET_FS_PWD_WITH_CONST */
{
struct path old_pwd;
+2 -2
View File
@@ -5480,7 +5480,7 @@ static boolean_t
arc_is_overflowing(void)
{
/* Always allow at least one block of overflow */
uint64_t overflow = MAX(SPA_MAXBLOCKSIZE,
int64_t overflow = MAX(SPA_MAXBLOCKSIZE,
arc_c >> zfs_arc_overflow_shift);
/*
@@ -5492,7 +5492,7 @@ arc_is_overflowing(void)
* in the ARC. In practice, that's in the tens of MB, which is low
* enough to be safe.
*/
return (aggsum_lower_bound(&arc_size) >= arc_c + overflow);
return (aggsum_lower_bound(&arc_size) >= (int64_t)arc_c + overflow);
}
static abd_t *
+2 -2
View File
@@ -73,7 +73,7 @@ bqueue_enqueue(bqueue_t *q, void *data, uint64_t item_size)
mutex_enter(&q->bq_lock);
obj2node(q, data)->bqn_size = item_size;
while (q->bq_size + item_size > q->bq_maxsize) {
cv_wait(&q->bq_add_cv, &q->bq_lock);
cv_wait_sig(&q->bq_add_cv, &q->bq_lock);
}
q->bq_size += item_size;
list_insert_tail(&q->bq_list, data);
@@ -91,7 +91,7 @@ bqueue_dequeue(bqueue_t *q)
uint64_t item_size;
mutex_enter(&q->bq_lock);
while (q->bq_size == 0) {
cv_wait(&q->bq_pop_cv, &q->bq_lock);
cv_wait_sig(&q->bq_pop_cv, &q->bq_lock);
}
ret = list_remove_head(&q->bq_list);
ASSERT3P(ret, !=, NULL);
+5 -30
View File
@@ -719,8 +719,8 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum, uint64_t *l1blks)
uint64_t blks;
uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1);
/* bytes of data covered by a level-1 indirect block */
uint64_t iblkrange =
dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT);
uint64_t iblkrange = (uint64_t)dn->dn_datablksz *
EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT);
ASSERT3U(minimum, <=, *start);
@@ -2373,39 +2373,14 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
return (err);
/*
* Check if there are dirty data blocks or frees which have not been
* synced. Dirty spill and bonus blocks which are external to the
* object can ignored when reporting holes.
* Check if dnode is dirty
*/
mutex_enter(&dn->dn_mtx);
for (i = 0; i < TXG_SIZE; i++) {
if (multilist_link_active(&dn->dn_dirty_link[i])) {
if (dn->dn_free_ranges[i] != NULL) {
clean = B_FALSE;
break;
}
list_t *list = &dn->dn_dirty_records[i];
dbuf_dirty_record_t *dr;
for (dr = list_head(list); dr != NULL;
dr = list_next(list, dr)) {
dmu_buf_impl_t *db = dr->dr_dbuf;
if (db->db_blkid == DMU_SPILL_BLKID ||
db->db_blkid == DMU_BONUS_BLKID)
continue;
clean = B_FALSE;
break;
}
}
if (clean == B_FALSE)
clean = B_FALSE;
break;
}
}
mutex_exit(&dn->dn_mtx);
/*
* If compatibility option is on, sync any current changes before
+9 -2
View File
@@ -158,9 +158,16 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
} else {
/*
* If we are not forcing, there must be no
* changes since fromsnap.
* changes since fromsnap. Raw sends have an
* additional constraint that requires that
* no "noop" snapshots exist between fromsnap
* and tosnap for the IVset checking code to
* work properly.
*/
if (dsl_dataset_modified_since_snap(ds, snap)) {
if (dsl_dataset_modified_since_snap(ds, snap) ||
(raw &&
dsl_dataset_phys(ds)->ds_prev_snap_obj !=
snap->ds_object)) {
dsl_dataset_rele(snap, FTAG);
return (SET_ERROR(ETXTBSY));
}
+10 -3
View File
@@ -214,6 +214,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data)
uint64_t end_of_access_blkid;
end_of_access_blkid = blkid + nblks;
spa_t *spa = zf->zf_dnode->dn_objset->os_spa;
krw_t rw = RW_READER;
if (zfs_prefetch_disable)
return;
@@ -234,7 +235,8 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data)
if (blkid == 0)
return;
rw_enter(&zf->zf_rwlock, RW_READER);
retry:
rw_enter(&zf->zf_rwlock, rw);
/*
* Find matching prefetch stream. Depending on whether the accesses
@@ -272,8 +274,13 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data)
* a new stream for it.
*/
ZFETCHSTAT_BUMP(zfetchstat_misses);
if (rw_tryupgrade(&zf->zf_rwlock))
dmu_zfetch_stream_create(zf, end_of_access_blkid);
if (rw == RW_READER && !rw_tryupgrade(&zf->zf_rwlock)) {
rw_exit(&zf->zf_rwlock);
rw = RW_WRITER;
goto retry;
}
dmu_zfetch_stream_create(zf, end_of_access_blkid);
rw_exit(&zf->zf_rwlock);
return;
}
+15 -1
View File
@@ -384,7 +384,21 @@ dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks,
}
}
if (trunc) {
/*
* Do not truncate the maxblkid if we are performing a raw
* receive. The raw receive sets the maxblkid manually and
* must not be overridden. Usually, the last DRR_FREE record
* will be at the maxblkid, because the source system sets
* the maxblkid when truncating. However, if the last block
* was freed by overwriting with zeros and being compressed
* away to a hole, the source system will generate a DRR_FREE
* record while leaving the maxblkid after the end of that
* record. In this case we need to leave the maxblkid as
* indicated in the DRR_OBJECT record, so that it matches the
* source system, ensuring that the cryptographic hashes will
* match.
*/
if (trunc && !dn->dn_objset->os_raw_receive) {
ASSERTV(uint64_t off);
dn->dn_phys->dn_maxblkid = blkid == 0 ? 0 : blkid - 1;
+10 -1
View File
@@ -3025,8 +3025,10 @@ dsl_scan_async_block_should_pause(dsl_scan_t *scn)
if (zfs_recover)
return (B_FALSE);
if (scn->scn_visited_this_txg >= zfs_async_block_max_blocks)
if (zfs_async_block_max_blocks != 0 &&
scn->scn_visited_this_txg >= zfs_async_block_max_blocks) {
return (B_TRUE);
}
elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||
@@ -3629,6 +3631,13 @@ count_block(dsl_scan_t *scn, zfs_all_blkstats_t *zab, const blkptr_t *bp)
{
int i;
/*
* Don't count embedded bp's, since we already did the work of
* scanning these when we scanned the containing block.
*/
if (BP_IS_EMBEDDED(bp))
return;
/*
* Update the spa's stats on how many bytes we have issued.
* Sequential scrubs create a zio for each DVA of the bp. Each
+13 -3
View File
@@ -2102,8 +2102,8 @@ spa_import_progress_destroy(void)
spa_history_list_t *shl = spa_import_progress_list;
procfs_list_uninstall(&shl->procfs_list);
spa_import_progress_truncate(shl, 0);
kmem_free(shl, sizeof (spa_history_list_t));
procfs_list_destroy(&shl->procfs_list);
kmem_free(shl, sizeof (spa_history_list_t));
}
int
@@ -2582,8 +2582,18 @@ spa_set_missing_tvds(spa_t *spa, uint64_t missing)
const char *
spa_state_to_name(spa_t *spa)
{
vdev_state_t state = spa->spa_root_vdev->vdev_state;
vdev_aux_t aux = spa->spa_root_vdev->vdev_stat.vs_aux;
ASSERT3P(spa, !=, NULL);
/*
* it is possible for the spa to exist, without root vdev
* as the spa transitions during import/export
*/
vdev_t *rvd = spa->spa_root_vdev;
if (rvd == NULL) {
return ("TRANSITIONING");
}
vdev_state_t state = rvd->vdev_state;
vdev_aux_t aux = rvd->vdev_stat.vs_aux;
if (spa_suspended(spa) &&
(spa_get_failmode(spa) != ZIO_FAILURE_MODE_CONTINUE))
+1 -4
View File
@@ -1852,13 +1852,10 @@ vdev_open(vdev_t *vd)
/*
* Track the min and max ashift values for normal data devices.
*
* DJB - TBD these should perhaps be tracked per allocation class
* (e.g. spa_min_ashift is used to round up post compression buffers)
*/
if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
vd->vdev_alloc_bias == VDEV_BIAS_NONE &&
vd->vdev_aux == NULL) {
vd->vdev_islog == 0 && vd->vdev_aux == NULL) {
if (vd->vdev_ashift > spa->spa_max_ashift)
spa->spa_max_ashift = vd->vdev_ashift;
if (vd->vdev_ashift < spa->spa_min_ashift)
+2 -1
View File
@@ -15,6 +15,7 @@
/*
* Copyright (c) 2014, 2017 by Delphix. All rights reserved.
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -902,7 +903,7 @@ vdev_obsolete_sm_object(vdev_t *vd, uint64_t *sm_obj)
}
int error = zap_lookup(vd->vdev_spa->spa_meta_objset, vd->vdev_top_zap,
VDEV_TOP_ZAP_INDIRECT_OBSOLETE_SM, sizeof (sm_obj), 1, sm_obj);
VDEV_TOP_ZAP_INDIRECT_OBSOLETE_SM, sizeof (uint64_t), 1, sm_obj);
if (error == ENOENT) {
*sm_obj = 0;
error = 0;
+9 -12
View File
@@ -1514,6 +1514,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
nvlist_t *zplprops = NULL;
dsl_crypto_params_t *dcp = NULL;
char *spa_name = zc->zc_name;
boolean_t unload_wkey = B_TRUE;
if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size,
zc->zc_iflags, &config)))
@@ -1541,11 +1542,8 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
(void) nvlist_lookup_nvlist(props, ZPOOL_ROOTFS_PROPS, &nvl);
if (nvl) {
error = nvlist_dup(nvl, &rootprops, KM_SLEEP);
if (error != 0) {
nvlist_free(config);
nvlist_free(props);
return (error);
}
if (error != 0)
goto pool_props_bad;
(void) nvlist_remove_all(props, ZPOOL_ROOTFS_PROPS);
}
@@ -1553,11 +1551,8 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
&hidden_args);
error = dsl_crypto_params_create_nvlist(DCP_CMD_NONE,
rootprops, hidden_args, &dcp);
if (error != 0) {
nvlist_free(config);
nvlist_free(props);
return (error);
}
if (error != 0)
goto pool_props_bad;
(void) nvlist_remove_all(props, ZPOOL_HIDDEN_ARGS);
VERIFY(nvlist_alloc(&zplprops, NV_UNIQUE_NAME, KM_SLEEP) == 0);
@@ -1577,15 +1572,17 @@ zfs_ioc_pool_create(zfs_cmd_t *zc)
* Set the remaining root properties
*/
if (!error && (error = zfs_set_prop_nvlist(spa_name,
ZPROP_SRC_LOCAL, rootprops, NULL)) != 0)
ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) {
(void) spa_destroy(spa_name);
unload_wkey = B_FALSE; /* spa_destroy() unloads wrapping keys */
}
pool_props_bad:
nvlist_free(rootprops);
nvlist_free(zplprops);
nvlist_free(config);
nvlist_free(props);
dsl_crypto_params_free(dcp, !!error);
dsl_crypto_params_free(dcp, unload_wkey && !!error);
return (error);
}
+4 -2
View File
@@ -4526,8 +4526,10 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
unlock_page(pp);
rangelock_exit(lr);
if (wbc->sync_mode != WB_SYNC_NONE)
wait_on_page_writeback(pp);
if (wbc->sync_mode != WB_SYNC_NONE) {
if (PageWriteback(pp))
wait_on_page_bit(pp, PG_writeback);
}
ZFS_EXIT(zfsvfs);
return (0);
+1 -1
View File
@@ -1255,7 +1255,7 @@ zfs_rezget(znode_t *zp)
ZFS_TIME_DECODE(&ZTOI(zp)->i_mtime, mtime);
ZFS_TIME_DECODE(&ZTOI(zp)->i_ctime, ctime);
if (gen != ZTOI(zp)->i_generation) {
if ((uint32_t)gen != ZTOI(zp)->i_generation) {
zfs_znode_dmu_fini(zp);
zfs_znode_hold_exit(zfsvfs, zh);
return (SET_ERROR(EIO));
+2 -2
View File
@@ -178,9 +178,9 @@ EOF
else
cat <<EOF
%post -n kmod-${kmodname}-${kernel_uname_r}
[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
%postun -n kmod-${kmodname}-${kernel_uname_r}
[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
EOF
fi
+1 -1
View File
@@ -635,7 +635,7 @@ tests = ['filesystem_count', 'filesystem_limit', 'snapshot_count',
tags = ['functional', 'limits']
[tests/functional/link_count]
tests = ['link_count_001']
tests = ['link_count_001', 'link_count_root_inode.ksh']
tags = ['functional', 'link_count']
[tests/functional/migration]
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# This file and its contents are supplied under the terms of the
View File
@@ -1,7 +1,5 @@
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/alloc_class
dist_pkgdata_SCRIPTS = \
alloc_class.cfg \
alloc_class.kshlib \
setup.ksh \
cleanup.ksh \
alloc_class_001_pos.ksh \
@@ -17,3 +15,7 @@ dist_pkgdata_SCRIPTS = \
alloc_class_011_neg.ksh \
alloc_class_012_pos.ksh \
alloc_class_013_pos.ksh
dist_pkgdata_DATA = \
alloc_class.cfg \
alloc_class.kshlib
@@ -45,6 +45,7 @@
# N 1 1 no keyformat given, but crypt off
# Y 0 0 no no keyformat specified for new key
# Y 0 1 no no keyformat specified for new key
# Y 1 1 no unsupported combination of non-encryption props
# Y 1 0 yes new encryption root
# Y 1 1 yes new encryption root
#
@@ -83,6 +84,10 @@ log_mustnot zpool create -O encryption=on $TESTPOOL $DISKS
log_mustnot zpool create -O encryption=on -O keylocation=prompt \
$TESTPOOL $DISKS
log_mustnot eval "echo $PASSPHRASE | zpool create -O encryption=on" \
"-O keyformat=passphrase -O keylocation=prompt" \
"-o feature@lz4_compress=disabled -O compression=lz4 $TESTPOOL $DISKS"
log_must eval "echo $PASSPHRASE | zpool create -O encryption=on" \
"-O keyformat=passphrase $TESTPOOL $DISKS"
log_must zpool destroy $TESTPOOL
@@ -1,5 +1,3 @@
#!/bin/ksh
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
@@ -3,7 +3,6 @@ dist_pkgdata_SCRIPTS = \
cleanup.ksh \
zpool_initialize_attach_detach_add_remove.ksh \
zpool_initialize_import_export.ksh \
zpool_initialize.kshlib \
zpool_initialize_offline_export_import_online.ksh \
zpool_initialize_online_offline.ksh \
zpool_initialize_split.ksh \
@@ -2,7 +2,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_trim
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
zpool_trim.kshlib \
zpool_trim_attach_detach_add_remove.ksh \
zpool_trim_import_export.ksh \
zpool_trim_multiple.ksh \
@@ -20,3 +19,6 @@ dist_pkgdata_SCRIPTS = \
zpool_trim_unsupported_vdevs.ksh \
zpool_trim_verify_checksums.ksh \
zpool_trim_verify_trimmed.ksh
dist_pkgdata_DATA = \
zpool_trim.kshlib
@@ -44,16 +44,20 @@
function cleanup
{
if [ -e $TEST_BASE_DIR/zfs_001_neg.$$.txt ]
if [ -e "$TEMPFILE" ]
then
rm $TEST_BASE_DIR/zfs_001_neg.$$.txt
rm -f "$TEMPFILE"
fi
}
log_onexit cleanup
log_assert "zfs shows a usage message when run as a user"
eval "zfs > $TEST_BASE_DIR/zfs_001_neg.$$.txt 2>&1"
log_must grep "usage: zfs command args" $TEST_BASE_DIR/zfs_001_neg.$$.txt
TEMPFILE="$TEST_BASE_DIR/zfs_001_neg.$$.txt"
eval "zfs > $TEMPFILE 2>&1"
log_must grep "usage: zfs command args" "$TEMPFILE"
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
log_pass "zfs shows a usage message when run as a user"
@@ -45,16 +45,20 @@
function cleanup
{
if [ -e $TEST_BASE_DIR/zpool_001_neg.$$.txt ]
if [ -e "$TEMPFILE" ]
then
rm $TEST_BASE_DIR/zpool_001_neg.$$.txt
rm -f "$TEMPFILE"
fi
}
TEMPFILE="$TEST_BASE_DIR/zpool_001_neg.$$.txt"
log_onexit cleanup
log_assert "zpool shows a usage message when run as a user"
eval "zpool > $TEST_BASE_DIR/zpool_001_neg.$$.txt 2>&1"
log_must grep "usage: zpool command args" $TEST_BASE_DIR/zpool_001_neg.$$.txt
eval "zpool > $TEMPFILE 2>&1"
log_must grep "usage: zpool command args" "$TEMPFILE"
log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE"
log_pass "zpool shows a usage message when run as a user"
@@ -2,8 +2,7 @@ include $(top_srcdir)/config/Rules.am
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/lib/libspl/include
LDADD = $(top_srcdir)/lib/libicp/libicp.la
LDADD += $(top_srcdir)/lib/libzpool/libzpool.la
LDADD = $(top_srcdir)/lib/libzpool/libzpool.la
AUTOMAKE_OPTIONS = subdir-objects
@@ -2,4 +2,5 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/link_count
dist_pkgdata_SCRIPTS = \
cleanup.ksh \
setup.ksh \
link_count_001.ksh
link_count_001.ksh \
link_count_root_inode.ksh
@@ -0,0 +1,119 @@
#!/bin/ksh
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright (c) 2019 by Tomohiro Kusumi. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
#
# DESCRIPTION:
# Verify root inode (directory) has correct link count.
#
# STRATEGY:
# 1. Create pool and fs.
# 2. Test link count of root inode.
# 3. Create directories and test link count of root inode.
# 4. Delete directories and test link count of root inode.
# 5. Create regular file and test link count of root inode.
# 6. Delete regular file and test link count of root inode.
#
function assert_link_count
{
typeset dirpath="$1"
typeset value="$2"
log_must test "$(ls -ld $dirpath | awk '{ print $2 }')" == "$value"
}
verify_runnable "both"
log_note "Verify root inode (directory) has correct link count."
# Delete a directory from link_count_001.ksh.
if [ -d "${TESTDIR}" -a -d "${TESTDIR}/tmp" ]; then
log_must rm -rf ${TESTDIR}/tmp
fi
#
# Test with hidden '.zfs' directory.
# This also tests general directories.
#
log_note "Testing with snapdir set to hidden (default)"
for dst in $TESTPOOL $TESTPOOL/$TESTFS
do
typeset mtpt=$(get_prop mountpoint $dst)
log_must zfs set snapdir=hidden $dst
log_must test -d "$mtpt/.zfs"
if test -n "$(ls $mtpt)"; then
ls $mtpt
log_note "$mtpt not empty, skipping"
continue
fi
assert_link_count $mtpt 2
log_must mkdir $mtpt/a
assert_link_count $mtpt 3
log_must rmdir $mtpt/a
assert_link_count $mtpt 2
log_must mkdir -p $mtpt/a/b
assert_link_count $mtpt 3
log_must rmdir $mtpt/a/b
log_must rmdir $mtpt/a
assert_link_count $mtpt 2
log_must touch $mtpt/a
assert_link_count $mtpt 2
log_must rm $mtpt/a
assert_link_count $mtpt 2
done
#
# Test with visible '.zfs' directory.
#
log_note "Testing with snapdir set to visible"
for dst in $TESTPOOL $TESTPOOL/$TESTFS
do
typeset mtpt=$(get_prop mountpoint $dst)
log_must zfs set snapdir=visible $dst
log_must test -d "$mtpt/.zfs"
if test -n "$(ls $mtpt)"; then
ls $mtpt
log_note "$mtpt not empty, skipping"
continue
fi
assert_link_count $mtpt 3
log_must mkdir $mtpt/a
assert_link_count $mtpt 4
log_must rmdir $mtpt/a
assert_link_count $mtpt 3
log_must mkdir -p $mtpt/a/b
assert_link_count $mtpt 4
log_must rmdir $mtpt/a/b
log_must rmdir $mtpt/a
assert_link_count $mtpt 3
log_must touch $mtpt/a
assert_link_count $mtpt 3
log_must rm $mtpt/a
assert_link_count $mtpt 3
done
log_pass "Verify root inode (directory) has correct link count passed"
@@ -28,6 +28,9 @@ dist_pkgdata_SCRIPTS = \
removal_with_send.ksh removal_with_send_recv.ksh \
removal_with_snapshot.ksh removal_with_write.ksh \
removal_with_zdb.ksh remove_mirror.ksh remove_mirror_sanity.ksh \
remove_raidz.ksh remove_expanded.ksh removal.kshlib
remove_raidz.ksh remove_expanded.ksh
dist_pkgdata_DATA = \
removal.kshlib
pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/removal
@@ -2,28 +2,28 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/reservation
dist_pkgdata_SCRIPTS = \
setup.ksh \
cleanup.ksh \
reservation_001_pos.sh \
reservation_002_pos.sh \
reservation_003_pos.sh \
reservation_004_pos.sh \
reservation_005_pos.sh \
reservation_006_pos.sh \
reservation_007_pos.sh \
reservation_008_pos.sh \
reservation_009_pos.sh \
reservation_010_pos.sh \
reservation_011_pos.sh \
reservation_012_pos.sh \
reservation_013_pos.sh \
reservation_014_pos.sh \
reservation_015_pos.sh \
reservation_016_pos.sh \
reservation_017_pos.sh \
reservation_018_pos.sh \
reservation_019_pos.sh \
reservation_020_pos.sh \
reservation_021_neg.sh \
reservation_022_pos.sh
reservation_001_pos.ksh \
reservation_002_pos.ksh \
reservation_003_pos.ksh \
reservation_004_pos.ksh \
reservation_005_pos.ksh \
reservation_006_pos.ksh \
reservation_007_pos.ksh \
reservation_008_pos.ksh \
reservation_009_pos.ksh \
reservation_010_pos.ksh \
reservation_011_pos.ksh \
reservation_012_pos.ksh \
reservation_013_pos.ksh \
reservation_014_pos.ksh \
reservation_015_pos.ksh \
reservation_016_pos.ksh \
reservation_017_pos.ksh \
reservation_018_pos.ksh \
reservation_019_pos.ksh \
reservation_020_pos.ksh \
reservation_021_neg.ksh \
reservation_022_pos.ksh
dist_pkgdata_DATA = \
reservation.cfg \
+1 -1
View File
@@ -1,5 +1,5 @@
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/perf
dist_pkgdata_SCRIPTS = \
dist_pkgdata_DATA = \
nfs-sample.cfg \
perf.shlib
@@ -1,4 +1,4 @@
#!/usr/bin/ksh
#!/bin/ksh
# file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version