summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* Switch KM_SLEEP to KM_PUSHPAGEChris Dunlop2012-10-041-1/+1
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fc for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1002
* Illumos #3100: zvol rename fails with EBUSY when dirty.Matthew Ahrens2012-10-038-32/+28
| | | | | | | | | | | | | | | | | illumos/illumos-gate@2e2c135528b3edfe9aaf67d1f004dc0202fa1a54 Illumos changeset: 13780:6da32a929222 3100 zvol rename fails with EBUSY when dirty Reviewed by: Christopher Siden <[email protected]> Reviewed by: Adam H. Leventhal <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Eric Schrock <[email protected]> Ported-by: Etienne Dechamps <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #995
* Illumos #2399: zfs manual page does not document use of "zfs diff".Richard Lowe2012-10-031-3/+97
| | | | | | | | | | | | | | | | | illumos/illumos-gate@3b8be6bf4fd2c744dfb8b5ce2a6c85ad0a2c8f75 Illumos changeset: 13773:00c2a08cf1bb 2399 zfs manual page does not document use of "zfs diff" Reviewed by: Joshua M. Clulow <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Yuri Pankov <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Etienne Dechamps <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #940
* Illumos #3129, #3130George Wilson2012-10-032-5/+17
| | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@d6afdce20f8481c95471dd821bc8ec0dbde66213 Illumos changeset: 13794:7c5e0e746b2c 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) Reviewed by: Eric Schrock <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 Ported by: Etienne Dechamps <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #994
* 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
* Fix VOP_CLOSE() in userspace.Etienne Dechamps2012-10-031-1/+1
| | | | | | | | | | | | | Currently, for unknown reasons, VOP_CLOSE() is a no-op in userspace. This causes file descriptor leaks. This is especially problematic with long ztest runs, since zpool.cache is opened repeatedly and never closed, resulting in resource exhaustion (EMFILE errors). This patch fixes the issue by making VOP_CLOSE() do what it is supposed to do. Signed-off-by: Brian Behlendorf <[email protected]> Issue #989
* Create threads in detached state in userspace.Etienne Dechamps2012-10-033-7/+11
| | | | | | | | | | | | | | | | | | | | | 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
* Modify vdev_elevator_switch() to use elevator_change()Brian Behlendorf2012-10-033-18/+49
| | | | | | | | | | | As of Linux 2.6.36 an elevator_change() interface was added. This commit updates vdev_elevator_switch() to use this interface when available, otherwise it falls back to the usermodehelper method. Original-patch-by: foobarz <sysop@xeon.(none)> Signed-off-by: Brian Behlendorf <[email protected]> Closes #906
* Force 4K blocksize when testing ext2 on zvol.Etienne Dechamps2012-10-031-1/+3
| | | | | | | | | | | | | | | Currently, mkfs.ext2 on zconfig.sh zvols tries to use a 8K blocksize, probably because by default zvol exposes an optimal I/O size of 8K. Unfortunately, a ext2 blocksize of 8K is not supported by the kernel, so the resulting filesystem is unmountable. This patch fixes the issue by making sure the blocksize is 4K. We have to use -F to force it else mkfs.ext2 won't allow us to use a blocksize smaller than the optimal I/O size. Signed-off-by: Brian Behlendorf <[email protected]> Closes #979
* Implement .commit_metadata hook for NFS exportCyril Plisko2012-10-033-1/+45
| | | | | | | | | | | In order to implement synchronous NFS metadata semantics ZFS needs to provide the .commit_metadata hook. All it takes there is to make sure changes are committed to ZIL. Fortunately zfs_fsync() does just that, so simply calling it from zpl_commit_metadata() does the trick. Signed-off-by: Brian Behlendorf <[email protected]> Closes #969
* zvol_probe should return NULL when the device isn't found.Chris Wedgwood2012-10-031-1/+1
| | | | | | | | | | | | | Previously we returned ERR_PTR(-ENOENT) which the rest of the kernel doesn't expect and as such we can oops. Signed-off-by: Chris Wedgwood <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #949 Closes #931 Closes #789 Closes #743 Closes #730
* Illumos #2703: add mechanism to report ZFS send progressBill Pijewski2012-09-1912-127/+312
| | | | | | | | | | | | | 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-1916-67/+383
| | | | | | | | | | | | | | | | | | 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
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-09-191-3/+3
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #973
* Seg fault 'zpool import -d /dev/disk/by-id -a'zfs-0.6.0-rc11Brian Behlendorf2012-09-181-1/+1
| | | | | | | | | Introduced by commit 44867b6d6effc1628dd00c36821ab044f89fb988. We should of course check to ensure best isn't NULL before attempting to dereference it. Signed-off-by: Brian Behlendorf <[email protected]> Closes #974
* zfs-0.6.0-rc11Brian Behlendorf2012-09-181-1/+1
|
* Illumos #2088 zdb could use a reasonable manual pageRichard Lowe2012-09-182-48/+470
| | | | | | | | | | | | | | | | 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-172-29/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-09-171-1/+1
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* ZFS replay transaction error 5Cyril Plisko2012-09-171-8/+7
| | | | | | | | | | | | | | | | | | | | When zfs_replay_write() replays TX_WRITE records from ZIL it calls zpl_write_common() to perform the actual write. zpl_write_common() returns the number of bytes written (similar to write() system call) or an (negative) error. However, the code expects the positive return value to be a residual counter. Thus when zpl_write_common() successfully completes it is mistakenly considered to be a partial write and the error code delivered further. At this point the ZIL processing is aborted with famous "ZFS replay transaction error 5" error message given to the message buffer. The fix is to compare the zpl_write_commmon() return value with the buffer size and flag error only when they disagree. Signed-off-by: Cyril Plisko <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #933
* Clear PG_writeback for sync I/O error caseBrian Behlendorf2012-09-141-0/+9
| | | | | | | | | | | | | | | Commit 2b2861362f7dd09cc3167df8fddb6e2cb475018a accidentally introduced this issue by only conditionally registering the commit callback in the async case. The error handing code for the dmu_tx_assign() failure case relied on there always being a registered commit callback to clear the PG_writeback bit. Since that is no longer strictly true for the synchronous case we must explicitly invoke the callback. Signed-off-by: Brian Behlendorf <[email protected]> Closes #961
* 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
* Move iput() after zfs_inode_update()Brian Behlendorf2012-09-121-2/+2
| | | | | | | | | | | | | | | When replaying an unlink/remove operation via zfs_rmdir() the object being removed will be instantiated by a call to zfs_dirent_lock(). This means that there is a single reference protecting the object. Right before the call to zfs_inode_update() this reference is dropped which may cause the object to be destroyed. This will result in a NULL dereference as shown by the stack trace is issue #782. This likely isn't an issue during normal operation because there is always an additional reference held on the object by the VFS. Signed-off-by: Brian Behlendorf <[email protected]> Closes #782
* Revert "Improve AF hard disk detection"Brian Behlendorf2012-09-113-59/+5
| | | | | | | | | | | | | | | | | | This reverts commit 395350c85d9903beba43bac7ae79092ae25f1526 which accidentally introduced issue #955. Pools using AF drives which were originally created with a sector size of 512 bytes will now be correctly detected to have physical sector size of 4096. This is desirable for a new pool, however for an existing pool abruptly changing the sector size causes problems. For this reason, this change is being reverted until the additional logic can be added to detect the existing pool case. Existing pools must use the ashift size stored in the label regardless of what the disk reports. This is critical for compatibility. Signed-off-by: Brian Behlendorf <[email protected]> Issue #955
* Avoid running exportfs on each zfs/zpool command invocationCyril Plisko2012-09-111-9/+30
| | | | | | | | | Delay executing exportfs command until its results are actually required. Signed-off-by: Cyril Plisko <[email protected]> Signed-off-by: Gunnar Beutner <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* 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]>
* Remove autotools productsChris Dunlop2012-09-112-337/+1
| | | | | | | spl_config.h.in is a generated file: remove and .gitignore it Signed-off-by: Chris Dunlop <[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
* Remove zvol device nodeBrian Behlendorf2012-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The 'zfs destroy' changes in 330d06f disrupted how zvol devices get removed on ZoL. However, it basically boils down to the fact that we are no longer reliably calling zvol_remove_minor() via zfs_ioc_destroy_snaps(). Therefore we add the missing call and handle things similarly to the existing zfs_unmount_snap() case. Ideally we would check if this is of type DMU_OST_ZFS or DMU_OST_ZVOL and just do the right thing as in zfs_ioc_destroy(). However, it looks like it would be fairly expensive to get the type, and it's harmless to simply attempt the umount and minor removal. This is also an issue in the latest FreeBSD and Illumos code. It was being tracked under the following issue, and we may want to refresh our code when they settle on what they want to do about it upstream. https://www.illumos.org/issues/3170 Signed-off-by: Brian Behlendorf <[email protected]> Issue #903
* 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]>
* Make ZFS filesystem id persistent across different machinesCyril Plisko2012-09-061-2/+4
| | | | | | | | | Use ZFS dataset fsid guid as a unique file system id, similar to what is done on Illumos/OpenSolaris. Signed-off-by: Cyril Plisko <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #888
* Increase the stack space in userspace.Etienne Dechamps2012-09-061-4/+9
| | | | | | | | | | | | | | | | | | In 1e33ac1e2677c898a0b5ef6207048c692cb51bf4, the maximum stack size for userspace tools was set to 8k to mimic the available kernel stack size. Unfortunately, due to differences in how the stack is used in userspace vs kernel space, spurious stack overflows could occur in userspace tools due to the limited stack size. This is especially true in ztest when debugging is enabled. This patch multiplies the userspace stack size by 4, which fixes the stack overflow issues. This comes at the price of not being able to catch stack size issues in userspace, but the previous solution proved unreliable anyway. Signed-off-by: Brian Behlendorf <[email protected]> Fixes #934.
* Disable page allocation warnings for ARC buffersBrian Behlendorf2012-09-061-2/+3
| | | | | | | | | | | | | | | | | | | | | Buffers for the ARC are normally backed by the SPL virtual slab. However, if memory is low, AND no slab objects are available, AND a new slab cannot be quickly constructed a new emergency object will be directly allocated. These objects can be as large as order 5 on a system with 4k pages. And because they are allocated with KM_PUSHPAGE, to avoid a potential deadlock, they are not allowed to initiate I/O to satisfy the allocation. This can result in the occasional allocation failure. However, since these allocations are allowed to block and perform operations such as memory compaction they will eventually succeed. Since this is not unexpected (just unlikely) behavior this patch disables the warning for the allocation failure. Signed-off-by: Brian Behlendorf <[email protected]> Issue #465
* Fix missing vdev names in zpool status outputMichael Martin2012-09-051-6/+6
| | | | | | | | | | | | | | | | Commit 858219c makes more sense down below in the 'if (verbose)' section of the code. Initially, buf and path will never point to the same location. Once 'path = buf' is set on a raidz vdev, the code may drop into the verbose section depending on the verbose flag. In here, using a tmpbuf makes sense since now 'buf == path'. This issue does not occur in the upstream Solaris code because their implementations of snprintf() allow for buf and path to be the same address. Signed-off-by: Brian Behlendorf <[email protected]> Closes #57
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-09-052-3/+3
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-09-042-2/+3
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* Improve AF hard disk detectionBrian Behlendorf2012-09-044-5/+62
| | | | | | | | | | | | | | | | | | | | | | | | Use the bdev_physical_block_size() interface to determine the minimize write size which can be issued without incurring a read-modify-write operation. This is used to set the ashift correctly to prevent a performance penalty when using AF hard disks. Unfortunately, this interface isn't entirely reliable because it's not uncommon for disks to misreport this value. For this reason you may still need to manually set your ashift with: zpool create -o ashift=12 ... The solution to this in the upstream Illumos source was to add a while list of known offending drives. Maintaining such a list will be a burden, but it still may be worth doing if we can detect a large number of these drives. This should be considered as future work. Reported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #916
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-09-041-1/+1
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* 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-026-2/+508
| | | | | | | | Obtained from: illumos-gate revision 11935:538c866aaac6 Source: ssh://[email protected]/illumos-gate Signed-off-by: Brian Behlendorf <[email protected]> Closes #905
* Switch KM_SLEEP to KM_PUSHPAGEChris Dunlop2012-09-022-6/+6
| | | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* Switch KM_SLEEP to KM_PUSHPAGEBrian Behlendorf2012-08-311-2/+2
| | | | | | | | | | | | | This warning indicates the incorrect use of KM_SLEEP in a call path which must use KM_PUSHPAGE to avoid deadlocking in direct reclaim. See commit b8d06fca089fae4680c3a552fc55c512bfb02202 for additional details. SPL: Fixing allocation for task txg_sync (6093) which used GFP flags 0x297bda7c with PF_NOFS set Signed-off-by: Brian Behlendorf <[email protected]> Issue #917
* Clear PG_writeback after zil_commit() for sync I/OBrian Behlendorf2012-08-301-3/+8
| | | | | | | | | | | | | | | | | When writing via ->writepage() the writeback bit was always cleared as part of the txg commit callback. However, when the I/O is also being written synchronsously to the zil we can immediately clear this bit. There is no need to wait for the subsequent TXG sync since the data is already safe on stable storage. This has been observed to reduce the msync(2) delay from up to 5 seconds down 10s of miliseconds. One workload which is expected to benefit from this are the intermittent samba hands described in issue #700. Signed-off-by: Brian Behlendorf <[email protected]> Closes #700 Closes #907