aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* Refresh links to web siteNed Bass2013-03-063-3/+3
| | | | | | | | A few files still refer to @behlendorf's private fork on github. Use the primary web site URL instead. Two typos are also corrected. Signed-off-by: Brian Behlendorf <[email protected]>
* Constify structures containing function pointersRichard Yao2013-03-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PaX team modified the kernel's modpost to report writeable function pointers as section mismatches because they are potential exploit targets. We could ignore the warnings, but their presence can obscure actual issues. Proper const correctness can also catch programming mistakes. Building the kernel modules against a PaX/GrSecurity patched Linux 3.4.2 kernel reports 133 section mismatches prior to this patch. This patch eliminates 130 of them. The quantity of writeable function pointers eliminated by constifying each structure is as follows: vdev_opts_t 52 zil_replay_func_t 24 zio_compress_info_t 24 zio_checksum_info_t 9 space_map_ops_t 7 arc_byteswap_func_t 5 The remaining 3 writeable function pointers cannot be addressed by this patch. 2 of them are in zpl_fs_type. The kernel's sget function requires that this be non-const. The final writeable function pointer is created by SPL_SHRINKER_DECLARE. The kernel's set_shrinker() and remove_shrinker() functions also require that this be non-const. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1300
* Fix hot sparesBrian Behlendorf2013-03-011-79/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue with hot spares in ZoL is because it opens all leaf vdevs exclusively (O_EXCL). On Linux, exclusive opens cause subsequent exclusive opens to fail with EBUSY. This could be resolved by not opening any of the devices exclusively, which is what Illumos does, but the additional protection offered by exclusive opens is desirable. It cleanly prevents you from accidentally adding an in-use non-ZFS device to your pool. To fix this we very slightly relaxed the usage of O_EXCL in the following ways. 1) Functions which open the device but only read had the O_EXCL flag removed and were updated to use O_RDONLY. 2) A common holder was added to the vdev disk code. This allow the ZFS code to internally open the device multiple times but non-ZFS callers may not. 3) An exception was added to make_disks() for hot spare when creating partition tables. For hot spare devices which are already opened exclusively we skip creating the partition table because this must already have been done when the disk was originally added as a hot spare. Additional minor changes include fixing check_in_use() to use a partition instead of a slice suffix. And is_spare() was moved above make_disks() to avoid adding a forward reference. Signed-off-by: Brian Behlendorf <[email protected]> Closes #250
* -x shouldn't warn about old on-disk format or unavailable featuresTim Connors2013-02-281-1/+4
| | | | | | | | | `zpool status -x` should only flag errors or where the pool is unavailable. If it imported fine but isn't using the latest features available in the code, that's not an error. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1319
* Honor 80 character limit in 'zpool status'Brian Behlendorf2013-01-311-2/+2
| | | | | | | | | This is a minor nit, but the second line of the 'action' message when you need to upgrade your pool to support feature flags exceeds the standard 80 character limit. Fix it by moving the word 'feature' on to the third line. Signed-off-by: Brian Behlendorf <[email protected]>
* Retire zpool_id infrastructureBrian Behlendorf2013-01-295-370/+1
| | | | | | | | | | | | | | | | | | | In the interest of maintaining only one udev helper to give vdevs user friendly names, the zpool_id and zpool_layout infrastructure is being retired. They are superseded by vdev_id which incorporates all the previous functionality. Documentation for the new vdev_id(8) helper and its configuration file, vdev_id.conf(5), can be found in their respective man pages. Several useful example files are installed under /etc/zfs/. /etc/zfs/vdev_id.conf.alias.example /etc/zfs/vdev_id.conf.multipath.example /etc/zfs/vdev_id.conf.sas_direct.example /etc/zfs/vdev_id.conf.sas_switch.example Signed-off-by: Brian Behlendorf <[email protected]> Closes #981
* vdev_id: improve keyword parsing flexibilityNed Bass2013-01-251-9/+11
| | | | | | | | | | | The vdev_id udev helper strictly requires configuration file keywords to always be anchored at the beginning of the line and to be followed by a space character. However, users may prefer to use indentation or tab delimitation. Improve flexibility by simply requiring a keyword to be the first field on the line. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1239
* Illumos #3397, #3398Christopher Siden2013-01-111-9/+17
| | | | | | | | | | | | | | | | | | | 3397 zdb <pool> <objnum> output is too verbose 3398 zdb can't dump feature flags zap objects Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Richard Lowe <[email protected]> Approved by: Dan McDonald <[email protected]> References: illumos/illumos-gate@e690fb27a7d1483f052505e1ff373d205f9dee99 https://www.illumos.org/issues/3397 https://www.illumos.org/issues/3398 Ported-by: Brian Behlendorf <[email protected]>
* Illumos #1884, #3028, #3048, #3049, #3060, #3061, #3093Yuri Pankov2013-01-111-391/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1884 Empty "used" field for zfs *space commands 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3093 zfs {user,group}space's -i is noop Reviewed by: Garry Mills <[email protected]> Reviewed by: Eric Schrock <[email protected]> Approved by: Richard Lowe <[email protected]> References: illumos/illumos-gate@89f5d17b06fc4132c983112b24836a779a0ed736 illumos changeset: 13803:b5e49d71ff0e https://www.illumos.org/issues/1884 https://www.illumos.org/issues/3028 https://www.illumos.org/issues/3048 https://www.illumos.org/issues/3049 https://www.illumos.org/issues/3060 https://www.illumos.org/issues/3061 https://www.illumos.org/issues/3093 Ported-by: Brian Behlendorf <[email protected]> Closes #1194
* Illumos #1377 `zpool status -D' should tell if there are no DDT entriesYuri Pankov2013-01-111-2/+8
| | | | | | | | | | | | | | | | 1337 `zpool status -D' should tell if there are no DDT entries Reviewed by: Eric Schrock <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Albert Lee <[email protected]> References: illumos/illumos-gate@ce72e614c133351311e87bbbe4eba8fea9e77768 illumos changeset: 13432:d1ad8d106d64 https://www.illumos.org/issues/1337 Ported-by: Brian Behlendorf <[email protected]>
* Add /sbin/fsck.zfs helperBrian Behlendorf2013-01-093-2/+12
| | | | | | | | | | A fsck helper to accomidate distributions that expect to be able to execute a fsck on all filesystem types. Currently this script does nothing but it could be extended to act as a compatibility wrapper for 'zpool scrub'. Signed-off-by: Brian Behlendorf <[email protected]> Closes #964
* Report realpath() canonicalization errorBrian Behlendorf2013-01-091-1/+2
| | | | | | | | Rather than just reporting the failure include the passed mount point and error number. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1153
* Illumos #3145, #3212George Wilson2013-01-081-0/+11
| | | | | | | | | | | | | | | | | | | | | 3145 single-copy arc 3212 ztest: race condition between vdev_online() and spa_vdev_remove() Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Justin T. Gibbs <[email protected]> Approved by: Eric Schrock <[email protected]> References: illumos-gate/commit/9253d63df408bb48584e0b1abfcc24ef2472382e illumos changeset: 13840:97fd5cdf328a https://www.illumos.org/issues/3145 https://www.illumos.org/issues/3212 Ported-by: Brian Behlendorf <[email protected]> Closes #989 Closes #1137
* Illumos #3349: zpool upgrade -V bumps the on disk version numberGeorge Wilson2013-01-081-21/+119
| | | | | | | | | | | | | | | | 3349 zpool upgrade -V bumps the on disk version number, but leaves the in core version Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Richard Lowe <[email protected]> Approved by: Dan McDonald <[email protected]> References: illumos/illumos-gate@25345e466695fbe736faa53b8f3413d8e8f81981 https://www.illumos.org/issues/3349 Ported-by: Brian Behlendorf <[email protected]>
* Illumos #3086: unnecessarily setting DS_FLAG_INCONSISTENT on asyncMatthew Ahrens2013-01-081-0/+3
| | | | | | | | | | | | | | 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets Reviewed by: Christopher Siden <[email protected]> Approved by: Eric Schrock <[email protected]> References: illumos/illumos-gate@ce636f8b38e8c9ff484e880d9abb27251a882860 illumos changeset: 13776:cd512c80fd75 https://www.illumos.org/issues/3086 Ported-by: Brian Behlendorf <[email protected]>
* Illumos #2762: zpool command should have better support for feature flagsChristopher Siden2013-01-081-78/+329
| | | | | | | | | | | | | 2762 zpool command should have better support for feature flags Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Eric Schrock <[email protected]> References: illumos/illumos-gate@57221772c3fc05faba04bf48ddff45abf2bbf2bd https://www.illumos.org/issues/2762 Ported-by: Brian Behlendorf <[email protected]>
* Illumos #3090 and #3102George Wilson2013-01-081-2/+21
| | | | | | | | | | | | | | | | | | | 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Eric Schrock <[email protected]> References: illumos/illumos-gate@dfbb943217bf8ab22a1a9d2e9dca01d4da95ee0b illumos changeset: 13777:b1e53580146d https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 Ported-by: Brian Behlendorf <[email protected]> Closes #939
* Revert "Temporarily disable the reguid test."Brian Behlendorf2013-01-081-6/+0
| | | | | | | | | This reverts commit d13524579162b35189804c357a63993be758b84c. Since feature flags have now been merged we can apply the real upstream fix from Illumos. Signed-off-by: Brian Behlendorf <[email protected]> Issue #997
* Illumos #2619 and #2747Christopher Siden2013-01-087-41/+803
| | | | | | | | | | | | | | | | | | | | | | 2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Dan Kruchinin <[email protected]> Approved by: Eric Schrock <[email protected]> References: illumos/illumos-gate@53089ab7c84db6fb76c16ca50076c147cda11757 illumos/illumos-gate@ad135b5d644628e791c3188a6ecbd9c257961ef8 illumos changeset: 13700:2889e2596bd6 https://www.illumos.org/issues/2619 https://www.illumos.org/issues/2747 NOTE: The grub specific changes were not ported. This change must be made to the Linux grub packages. Ported-by: Brian Behlendorf <[email protected]>
* Allow fake mounts to succeed on non-legacy filesystems.Will Rouesnel2013-01-071-1/+2
| | | | | | | | | | | | | mountall in Debian depends on being able to pass the -f parameter to mount, which specifies a fake mount and just updates the mtab. Currently mount.zfs will fail such a request if it is not passed with -o zfsutil. This patch allows a fake mount on a non-legacy filesystem to succeed in the same manner as a -o remount does, thus enabling mountall to work correctly. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1167
* vdev_id support for device link aliasesNed Bass2012-12-031-142/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a vdev_id feature to map device names based on already defined udev device links. To increase the odds that vdev_id will run after the rules it depends on, increase the vdev.rules rule number from 60 to 69. With this change, vdev_id now provides functionality analogous to zpool_id and zpool_layout, paving the way to retire those tools. A defined alias takes precedence over a topology-derived name, but the two naming methods can otherwise coexist. For example, one might name drives in a JBOD with the sas_direct topology while naming an internal L2ARC device with an alias. For example, the following lines in vdev_id.conf will result in the creation of links /dev/disk/by-vdev/{d1,d2}, each pointing to the same target as the device link specified in the third field. # by-vdev # name fully qualified or base name of device link alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca alias d2 wwn-0x5000c5002def789e Also perform some minor vdev_id cleanup, such as removal of the unused -s command line option. Signed-off-by: Brian Behlendorf <[email protected]> Closes #981
* Make zpool attach -o ashift=... actually workCyril Plisko2012-11-301-1/+1
| | | | | | | | | Commit df83110856950c8e7b16a7e94cdf42b8531b9cc8 missed update to getopt() call, while delivering all the rest. This commit adds "o" to getopt(). Signed-off-by: Brian Behlendorf <[email protected]> Issue #566
* vdev_id fails to handle complex device topologiesCyril Plisko2012-11-291-4/+4
| | | | | | | | | | | | While expanding positional parameters shell requires non-single digits to be enclosed in braces. When the SAS topology is non-trivial the number of positional parameters generated internally by vdev_id script (using set -- ...) easily crosses single digit limit and vdev_id fails to generate links. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1119
* Make vdev_id POSIX sh compatibleNed Bass2012-11-271-16/+23
| | | | | | | | | | | Full bash may not be available in all environments where udev helpers run, such as in an initial ramdisk. To avoid breakage in this case, remove use of bash-specific features such as variable arrays and the `declare' keyword from the vdev_id script. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #870
* mount.zfs: canonicalize mount point for mtabnordaux2012-11-151-2/+9
| | | | | | | | | | | | | | | | Canonicalize the mount point passed to the mount.zfs helper. This way a clean path is always added to mtab which ensures the umount can properly locate and remove the entry. Test case: $ mkdir /mnt/foo $ mount -t zfs zpool/foo /mnt/../mnt/foo//// $ umount /mnt/foo $ cat /etc/mtab | grep zpool/foo zpool/foo /mnt/../mnt/foo//// zfs rw 0 0 Signed-off-by: Brian Behlendorf <[email protected]> Closes #573
* Add "-o ashift" to zpool add and zpool attachCyril Plisko2012-11-151-8/+43
| | | | | | | | | | | | | | | | When adding devices to an existing pool "ashift" property is auto-detected. However, if this property was overridden at the pool creation time (i.e. zpool create -o ashift=12 tank ...) this may not be what the user wants. This commit lets the user specify the value of "ashift" property to be used with newly added drives. For example, zpool add -o ashift=12 tank disk1 zpool attach -o ashift=12 tank disk1 disk2 Signed-off-by: Cyril Plisko <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #566
* Illumos #2671: zpool import should not fail if vdev ashift has increasedGeorge Wilson2012-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Gordon Ross <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Richard Lowe <[email protected]> Refererces to Illumos issue: https://www.illumos.org/issues/2671 This patch has been slightly modified from the upstream Illumos version. In the upstream implementation a warning message is logged to the console. To prevent pointless console noise this notification is now posted as a "ereport.fs.zfs.vdev.bad_ashift" event. The event indicates a non-optimial (but entirely safe) ashift value was used to create the pool. Depending on your workload this may impact pool performance. Unfortunately, the only way to correct the issue is to recreate the pool with a new ashift. NOTE: The unrelated fix to the comment in zpool_main.c appears in the upstream commit and was preserved for consistnecy. Ported-by: Cyril Plisko <[email protected]> Reworked-by: Brian Behlendorf <[email protected]> Closes #955
* Add ddt_object_count() error handlingBrian Behlendorf2012-10-291-1/+3
| | | | | | | | | | | | | | | | | | | The interface for the ddt_zap_count() function assumes it can never fail. However, internally ddt_zap_count() is implemented with zap_count() which can potentially fail. Now because there was no way to return the error to the caller a VERIFY was used to ensure this case never happens. Unfortunately, it has been observed that pools can be damaged in such a way that zap_count() fails. The result is that the pool can not be imported without hitting the VERIFY and crashing the system. This patch reworks ddt_object_count() so the error can be safely caught and returned to the caller. This allows a pool which has be damaged in this way to be safely rewound for import. Signed-off-by: Brian Behlendorf <[email protected]> Closes #910
* Allow 'zpool replace' to use short device namesBrian Behlendorf2012-10-221-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'zpool replace' command would fail when given a short name because unlike on other platforms the short name cannot be deterministically expanded to a single path. Multiple path prefixes must be checked and in addition the partition suffix for whole disks is determined by the prefix. To handle this complexity a zfs_strcmp_pathname() function was added which takes either a short or fully qualified device name. Short names will be expanded using the prefixes in the default import search path, or the ZPOOL_IMPORT_PATH environment variable if it's defined. All posible expansions are then compared against the comparison path. Care is taken to strip redundant slashes to ensure legitimate matches are not missed. In the context of this work the existing zfs_resolve_shortname() function was extended to consider the ZPOOL_IMPORT_PATH when set. The zfs_append_partition() interface was also simplified to take only a single buffer. The vast majority of these changes rework existing Linux specific code which was originally written to accomidate udev. However, there is some minimal cleanup which removes Illumos specific code. This was done to improve readability but the basic flow and intent of the upstream code was maintained. These changes are the logical conclusion of the previos work to adjust the 'zpool import' search behavior, see commit 44867b6a. Signed-off-by: Brian Behlendorf <[email protected]> Closes #544 Closes #976
* Disable ztest deadman timerBrian Behlendorf2012-10-141-0/+4
| | | | | | | | | | | The ztest deadman timer has been causing false positives in the testing VMs. To make it easier to spot possible regressions I'm disabling this timer. The buildbot test infrastructure will still mark ztest instances which take to long to complete as failures. Signed-off-by: Brian Behlendorf <[email protected]> Issue #1018
* Realpath arg 2 must be a minimum of PATH_MAXBrian Behlendorf2012-10-041-2/+8
| | | | | | | | | | | | | | | | The realpath(3) function expects that when a buffer is passed for the 'resolved_path' that it be at least PATH_MAX in length. If it's not a buffer overflow may occur. Therefore the passed buffer size is changed from MAXNAMELEN to MAXPATHLEN. We also take this opertunity to dynamically allocate the buffer to keep it off the stack. warning: call to '__realpath_chk_warn' declared with attribute warning: second argument of realpath must be either NULL or at least PATH_MAX bytes long buffer [enabled by default] Signed-off-by: Brian Behlendorf <[email protected]>
* Verify the return value for warn_unused_result functionsBrian Behlendorf2012-10-041-3/+3
| | | | | | | | | | | | | | | | | | | Under Linux the following functions are flagged with the attribute warn_unused_result, this triggers a warning when ever they are used without checking the return value. To handle this case we check the result VERIFY(). It's better to detect this immediately on failure rather than segfault farther down in the function. ../../cmd/ztest/ztest.c:6033:2: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] ../../cmd/ztest/ztest.c:739:3: warning: ignoring return value of 'realpath', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Brian Behlendorf <[email protected]>
* Replace tempnam() with mkstemp()Brian Behlendorf2012-10-041-4/+4
| | | | | | | | | | | | | | | | | | | | The use of tempnam() is racy and it should be avoided in favor of mkstemp(). According to the Linux tempnam(3) man page. "Although tempnam() generates names that are difficult to guess, it is nevertheless possible that between the time that tempnam() returns a pathname, and the time that the program opens it, another program might create that pathname using open(2), or create it as a symbolic link. This can lead to security holes. To avoid such possibilities, use the open(2) O_EXCL flag to open the pathname. Or better yet, use mkstemp(3) or tmpfile(3)." This issue was flagged by gcc. ztest.o: In function `setup_data_fd': cmd/ztest/ztest.c:5822: warning: the use of `tempnam' is dangerous, better use `mkstemp' Signed-off-by: Brian Behlendorf <[email protected]>
* Minimize ztest stack frame sizeBrian Behlendorf2012-10-041-4/+13
| | | | | | | | | | | | | To ensure ztest behaves as similarly as possible to the kernel implementation of ZFS we attempt to honor the kernel stack limits. This includes keeping the individual stack frame sizes under 1K in size. We currently use gcc to detect and enforce this limit. Therefore to get this building cleanly with full debugging enabled the stack usage in the following functions has been reduced by moving the buffer to the heap. Signed-off-by: Brian Behlendorf <[email protected]>
* Use dynamic file descriptor numbers in ztest.Etienne Dechamps2012-10-041-31/+28
| | | | | | | | | | | | | | | | | | | Currently, ztest expects to get 3 and 4 as the file descriptors for data and random files, respectively. This is quite fragile and breaks easily if ztest is run with these file descriptors already opened (e.g. in a complex shell script). This patch fixes the issue by removing the assumptions on the file descriptor numbers that open() returns. For the random file (/dev/urandom), the new code doesn't rely on a shared file descriptor; instead, it reopens the file in the child. For the data file, the new code writes the file descriptor number into a "ZTEST_FD_DATA" environment variable so that it can be recovered after the execv() call. Signed-off-by: Brian Behlendorf <[email protected]>
* Fix mmap() usage in ztest.Christopher Siden2012-10-041-6/+21
| | | | | | | | | | | | | | | | illumos/illumos-gate@ad135b5d644628e791c3188a6ecbd9c257961ef8 Illumos changeset: 13700:2889e2596bd6 Note that this is only a partial port of the aforementioned Illumos changeset. Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Dan Kruchinin <[email protected]> Approved by: Eric Schrock <[email protected]> Ported to zfsonlinux by: Etienne Dechamps <[email protected]>
* Illumos #1950: ztest backwards compatibility testing option.Chris Siden2012-10-041-376/+699
| | | | | | | | | | | | | | | | | illumos/illumos-gate@420dfc9585ff67e83ee7800a7ad2ebe1a9145983 Illumos changeset: 13571:a5771a96228c 1950 ztest backwards compatibility testing option Reviewed by: George Wilson <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Approved by: Eric Schrock <[email protected]> Ported-by: Etienne Dechamps <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Temporarily disable the reguid test.Etienne Dechamps2012-10-031-0/+6
| | | | | | | | | | | | | | | | | | | | | Currently, ztest fails with the following error: error: Pool 'ztest' has encountered an uncorrectable I/O failure and the failure mode property for this pool is set to panic. We know how to fix it (see issue #939), but it may take some time before we get around to merging the fix, which has some heavy dependencies. In the mean time, it is not ideal to be unable to use ztest just because of a small isolated issue, so this patch works around the problem by disabling the reguid test. This is just a temporary hack to keep ztest usable. The reguid test will be enabled again when the proper fix is merged. Signed-off-by: Brian Behlendorf <[email protected]> Closes #997
* Fix ztest vdev file paths.Etienne Dechamps2012-10-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Currently, in several instances (but not all), ztest generates vdev file paths using a statement similar to this: snprintf(path, sizeof (path), ztest_dev_template, ...); This worked fine until 40b84e7aec6392187722e61e5a4a853b530bf60f, which changed path to be a pointer to the heap instead of an array allocated on the stack. Before this change, sizeof(path) would return the size of the array; now, it returns the size of the pointer instead. As a result, the aforementioned sprintf statement uses the wrong size and truncates the vdev file path to the first 4 or 8 bytes (depending on the architecture). Typically, with default settings, the file path will become "/tmp/zt" instead of "/test/ztest.XXX". This issue only exists in ztest_vdev_attach_detach() and ztest_fault_inject(), which explains why ztest doesn't fail right away. Signed-off-by: Brian Behlendorf <[email protected]> Issue #989
* Create threads in detached state in userspace.Etienne Dechamps2012-10-031-4/+7
| | | | | | | | | | | | | | | | | | | | | Currently, thread_create(), when called in userspace, creates a joinable (i.e. not detached thread). This is the pthread default. Unfortunately, this does not reproduce kthreads behavior (kthreads are always detached). In addition, this contradicts the original Solaris code which creates userspace threads in detached mode. These joinable threads are never joined, which leads to a leakage of pthread thread objects ("zombie threads"). This in turn results in excessive ressource consumption, and possible ressource exhaustion in extreme cases (e.g. long ztest runs). This patch fixes the issue by creating userspace threads in detached mode. The only exception is ztest worker threads which are meant to be joinable. Signed-off-by: Brian Behlendorf <[email protected]> Issue #989
* Illumos #2703: add mechanism to report ZFS send progressBill Pijewski2012-09-191-0/+2
| | | | | | | | | | | | | Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Reviewed by: Richard Lowe <[email protected]> Approved by: Eric Schrock <[email protected]> References: https://www.illumos.org/issues/2703 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #1948: zpool list should show more detailed pool infoChris Siden2012-09-191-35/+207
| | | | | | | | | | | | | | | | | | Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Albert Lee <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Eric Schrock <[email protected]> References: https://www.illumos.org/issues/1948 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #685
* Illumos #2088 zdb could use a reasonable manual pageRichard Lowe2012-09-181-8/+11
| | | | | | | | | | | | | | | | Reviewed by: Yuri Pankov <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Steve Gonczi <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Garrett D'Amore <[email protected]> References: https://www.illumos.org/issues/2088 Ported by: Cyril Plisko <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #682
* Improve `zpool import` search behaviorBrian Behlendorf2012-09-171-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this change is to make 'zpool import' prefer to use the peristent /dev/mapper or /dev/disk/by-* paths. These are far preferable to the devices in /dev/ whos names are not persistent and are determined by the order in which a device is detected. This patch improves things by changing the default search path from just to the top level /dev/ directory to (in order): /dev/disk/by-vdev - Custom rules, use first if they exist /dev/disk/zpool - Custom rules, use first if they exist /dev/mapper - Use multipath devices before components /dev/disk/by-uuid - Single unique entry and persistent /dev/disk/by-id - May be multiple entries and persistent /dev/disk/by-path - Encodes physical location and persistent /dev/disk/by-label - Custom persistent labels /dev - UNSAFE device names will change The default search path can be overriden by setting the ZPOOL_IMPORT_PATH environment variable. This must be a colon delimited list of paths which are searched for vdevs. If the 'zpool import -d' option is specified only those listed paths will be searched. Finally, when multiple paths to the same device are found. If one of the paths is an exact match for the path used last time to import the pool it will be used. When there are no exact matches the prefered path will be determined by the provided search order. This means you can still import a pool and force specific names by providing the -d <path> option. And the prefered names will persist as long as those paths exist on your system. Signed-off-by: Brian Behlendorf <[email protected]> Closes #965
* Fix zdb printf format string for ZIL data blocksCyril Plisko2012-09-131-1/+2
| | | | | | | | | | | | | | | | | | | | | Without this fix the zdb printouts of ZIL data blocks look full of FF due to printf() handling its arguments as int by default. Here is the output before the fix TX_WRITE len 4136, txg 1093817, seq 149231 foid 4242, offset 0, length f68 G FFFFFF8EFFFFFF87FFFFFF91FFFFFFCC 1c FFFFFFAFFFFFFFC9FFFFFFBAZ FFFFFFC3 And the same after the fix TX_WRITE len 4136, txg 1093817, seq 149231 foid 4242, offset 0, length f68 G 8E8791CC 1cAFC9BAZ C3 Signed-off-by: Brian Behlendorf <[email protected]> Closes #962
* Illumos #3064: usr/src/cmd/zpool/zpool_main.c misspells "successful"Cyril Plisko2012-09-111-1/+1
| | | | | | | | | | | | Reviewed by: Andrew Stormont <[email protected]> Reviewed by: Kartik Mistry <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> References: https://www.illumos.org/issues/3064 Signed-off-by: Cyril Plisko <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Silence "setting dataset to sync always" message in ztest.Etienne Dechamps2012-09-101-1/+2
| | | | | | | | | | | | ztest outputs a message when testing sync=always no matter what the verbosity level is. There is no point outputting this message for low verbosity levels. With this patch the message is only displayed at verbosity level 5 or above. The result is less output pollution. Signed-off-by: Brian Behlendorf <[email protected]> Closes #951
* Add zstreamdump .gitignoreBrian Behlendorf2012-09-061-0/+1
| | | | | | | When zstreamdump was merged in commit b79fc3f we failed to add the needed .gitignore file. Signed-off-by: Brian Behlendorf <[email protected]>
* Add libnvpair to mount_zfs dependenciesEtienne Dechamps2012-09-021-0/+1
| | | | | | | | | | | Commit e6f290535c2fff8b940c4eacb1c90cbc2cfc7508 added libzpool to the mount_zfs dependencies. This brought in the nvpair symbols which are used by libzpool. To resolve this include the libnvpair library for mount_zfs even though mount_zfs doesn't directly require any of these symbols. Signed-off-by: Brian Behlendorf <[email protected]> Closes #926
* Add zstreamdump(8) command to examine ZFS send streams.Martin Matuska2012-09-023-1/+458
| | | | | | | | Obtained from: illumos-gate revision 11935:538c866aaac6 Source: ssh://[email protected]/illumos-gate Signed-off-by: Brian Behlendorf <[email protected]> Closes #905