aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Pre-allocate vdev I/O buffersBrian Behlendorf2012-08-274-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vdev queue layer may require a small number of buffers when attempting to create aggregate I/O requests. Rather than attempting to allocate them from the global zio buffers, which is slow under memory pressure, it makes sense to pre-allocate them because... 1) These buffers are short lived. They are only required for the life of a single I/O at which point they can be used by the next I/O. 2) The maximum number of concurrent buffers needed by a vdev is small. It's roughly limited by the zfs_vdev_max_pending tunable which defaults to 10. By keeping a small list of these buffer per-vdev we can ensure one is always available when we need it. This significantly reduces contention on the vq->vq_lock, because we no longer need to perform a slow allocation under this lock. This is particularly important when memory is already low on the system. It would probably be wise to extend the use of these buffers beyond aggregate I/O and in to the raidz implementation. The inability to quickly allocate buffer for the parity stripes could result in similiar problems. Signed-off-by: Brian Behlendorf <[email protected]>
* Revert Disable direct reclaim for z_wr_* threadsRichard Yao2012-08-272-7/+3
| | | | | | | | | | | | | | This commit used PF_MEMALLOC to prevent a memory reclaim deadlock. However, commit 49be0ccf1fdc2ce852271d4d2f8b7a9c2c4be6db eliminated the invocation of __cv_init(), which was the cause of the deadlock. PF_MEMALLOC has the side effect of permitting pages from ZONE_DMA to be allocated. The use of PF_MEMALLOC was found to cause stability problems when doing swap on zvols. Since this technique is known to cause problems and no longer fixes anything, we revert it. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #726
* Revert Fix zpl_writepage() deadlockRichard Yao2012-08-271-14/+1
| | | | | | | | | | | | | | | | | | | | | The commit, cfc9a5c88f91f7b4d606fce89505e1f404691ea5, to fix deadlocks in zpl_writepage() relied on PF_MEMALLOC. That had the effect of disabling the direct reclaim path on all allocations originating from calls to this function, but it failed to address the actual cause of those deadlocks. This led to the same deadlocks being observed with swap on zvols, but not with swap on the loop device, which exercises this code. The use of PF_MEMALLOC also had the side effect of permitting allocations to be made from ZONE_DMA in instances that did not require it. This contributes to the possibility of panics caused by depletion of pages from ZONE_DMA. As such, we revert this patch in favor of a proper fix for both issues. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #726
* Revert Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))Richard Yao2012-08-271-13/+0
| | | | | | | | | | | Commit eec8164771bee067c3cd55ed0a16dadeeba276de worked around an issue involving direct reclaim through the use of PF_MEMALLOC. Since we are reworking thing to use KM_PUSHPAGE so that swap works, we revert this patch in favor of the use of KM_PUSHPAGE in the affected areas. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #726
* Remove autoconf check for CONFIG_PREEMPTPrakash Surya2012-08-271-19/+0
| | | | | | | | | | | The autoconf macro which failed if CONFIG_PREEMPT was set in the kernel config was removed. With the inclusion of a few previous patches targeting support for preempt enabled kernels, it is now safe to run with this kernel config option enabled. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #83
* Remove autotools productsBrian Behlendorf2012-08-2767-80582/+19
| | | | | | | | Remove all of the generated autotools products from the repository and update the .gitignore files accordingly. Signed-off-by: Brian Behlendorf <[email protected]> Closes #718
* rmdir(2) should return ENOTEMPTYBrian Behlendorf2012-08-261-3/+3
| | | | | | | | | | | | | | | Under Solaris the behavior for rmdir(2) is to return EEXIST when a directory still contains entries. However, on Linux ENOTEMPTY is the expected return value with EEXIST being technically allowed. According to rmdir(2): ENOTEMPTY pathname contains entries other than . and .. ; or, pathname has .. as its final component. POSIX.1-2001 also allows EEXIST for this condition. Signed-off-by: Brian Behlendorf <[email protected]> Closes #895
* Consistent menuconfig nameRichard Yao2012-08-261-1/+1
| | | | | | | | Make name in Linux menuconfig consistent with those of other filesystems Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #897
* Check kernel source directory for SPLRichard Yao2012-08-262-0/+21
| | | | | | | | | | | ZFS fails to build when SPL is built into the kernel on unless --with-spl=/path/to/kernel/sources is specified. We fallback to the kernel sources directory when SPL is not found elsewhere to resolve that. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closed #896
* Illumos #3085: zfs diff panics, then panics in a loop on bootingChristopher Siden2012-08-251-4/+5
| | | | | | | | | | | Reviewed by: Matt Ahrens <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/3085 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #2901: zfs receive fails for exabyte sparse filesSimon Klinkert2012-08-251-0/+3
| | | | | | | | | | | Reviewed by: Matthew Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/2901 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Drop spill buffer referenceJaven Wu2012-08-251-2/+22
| | | | | | | | | | | | | | | | | | | When calling sa_update() and friends it is possible that a spill buffer will be needed to accomidate the update. When this happens a hold is taken on the new dbuf and that hold must be released before calling dmu_tx_commit(). Failing to release the hold will cause a copy of the dbuf to be made in dbuf_sync_leaf(). This is done to ensure further updates to the dbuf never sneak in to the syncing txg. This could be left to the sa_update() caller. But then the caller would need to be aware of this internal SA implementation detail. It is therefore preferable to handle this all internally in the SA implementation. Signed-off-by: Brian Behlendorf <[email protected]> Closes #503 Closes #513
* Revert "Use SA_HDL_PRIVATE for SA xattrs"Brian Behlendorf2012-08-251-28/+5
| | | | | | | | | | | | This reverts commit ec2626ad3f695a2ced3946c4197ef64cbcac4959 which caused consistency problems between the shared and private handles. Reverting this change should resolve issues #709 and #727. It will also reintroduce an arc_anon memory leak which is addressed by the next commit. Signed-off-by: Brian Behlendorf <[email protected]> Closes #709 Closes #727
* Wrap smp_processor_id in kpreempt_[dis|en]ablePrakash Surya2012-08-243-2/+22
| | | | | | | | | | | | | After surveying the code, the few places where smp_processor_id is used were deemed to be safe to use with a preempt enabled kernel. As such, no core logic had to be changed. These smp_processor_id call sites are simply are wrapped in kpreempt_disable and kpreempt_enabled to prevent the Linux kernel from emitting scary warnings. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Issue #83
* Fix snapshot automounting with GrSecurity constify plugin.Massimo Maggi2012-08-242-10/+10
| | | | | | | | | | | | | | | | | | | | | | | ./configure erroneously detects absence of dops->d_automount when built against a GrSecurity patched kernel. Summerized error message found in config.log: checking whether dops->d_automount() exists ... In function 'main': ... error: constified variable 'dops' cannot be local The "dops" variable cannot be a local variable, so it's moved to the global scope. This test also fails if the prototype of the dops->d_automount function pointer is changed. Signed-off-by: Massimo Maggi <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #884
* Illumos #2803: zfs get guid pretty-prints the outputGarrett D'Amore2012-08-231-0/+12
| | | | | | | | | | | | | Reviewed by: Eric Schrock <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Alexander Eremin <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/2803 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #1796, #2871, #2903, #2957Christopher Siden2012-08-234-11/+66
| | | | | | | | | | | | | | | | | | | 1796 "ZFS HOLD" should not be used when doing "ZFS SEND" from a read-only pool 2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite 2903 zfs destroy -d does not work 2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Eric Schrock <[email protected]> References: https://www.illumos.org/issues/1796 https://www.illumos.org/issues/2871 https://www.illumos.org/issues/2903 https://www.illumos.org/issues/2957 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #2635: 'zfs rename -f' to perform force unmountEric Schrock2012-08-234-15/+31
| | | | | | | | | | | | | | | Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Bill Pijewski <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/2635 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #717
* Illumos #1936: add support for "-t <datatype>" argument to zfs getAndrew Stormont2012-08-232-6/+40
| | | | | | | | | | | | | | | Reviewed by: Kartik Mistry <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Richard Elling <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/1936 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #681
* Illumos #1726: Removal of pyzfs broke delegation for volumesAlexander Eremin2012-08-231-4/+4
| | | | | | | | | | | | | | Reviewed by: Andrew Stormont <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Garrett D'Amore <[email protected]> References: https://www.illumos.org/issues/1726 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #1977: zfs allow arguments not parsed correctly after pyzfs removalAlexander Eremin2012-08-231-2/+2
| | | | | | | | | | | | Reviewed by: Garrett D'Amore <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/1977 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Add copy-builtin to EXTRA_DISTBrian Behlendorf2012-08-232-2/+2
| | | | | | | | The copy-builtin script was accidentally not being included in the tarballs. Signed-off-by: Brian Behlendorf <[email protected]> Closes #880
* Properly initialize and free destroydataMartin Matuska2012-08-231-0/+2
| | | | | | | | | | This regression was accidentally introduced by commit 330d06f90d143b41b276796526a66a1c1fff046d due to ZoL specific code. The fix is to simply ensure the passed nvlist is initialized and freed. Signed-off-by: Brian Behlendorf <[email protected]> Closes #876
* ZFS 0.6.0-rc10zfs-0.6.0-rc10Brian Behlendorf2012-08-141-1/+1
|
* Export dmu_buf_rele() symbolBrian Behlendorf2012-08-141-0/+1
| | | | | | | | | While I'd like to remove the various pragmas in module/zfs/dbuf.c. There are consumers such as Lustre which still depend on dmu_buf_* versions of the symbols. Until all consumers can be converted to use only the dbuf_* names leave this symbol exported. Signed-off-by: Brian Behlendorf <[email protected]>
* Cleanly remove zfs-modules-devel headersBrian Behlendorf2012-08-131-3/+11
| | | | | | | | | | | | | | Add the /usr/src/zfs-<version>-<release>/<kernel> directory to the zfs-modules-devel package. This ensures that this directory will be removed when the package is removed. We do not include the higher level /usr/src/zfs-<version>-<release> directory since there may be builds for multiple kernels. Instead, a %postun rmdir is added which attempts to remove this directory. It will only succeed when the last zfs-modules-devel-* package for this specific release is removed. Signed-off-by: Brian Behlendorf <[email protected]>
* Suppress 'zfs_sb_create' memory warningBrian Behlendorf2012-08-101-1/+1
| | | | | | | | | | When mutex debugging is enabled in your kernel the increased size of the mutex structures can push the zfs_sb_t type beyond the 8k warning threshold. This isn't harmful so we suppress the warning for this case. Signed-off-by: Brian Behlendorf <[email protected]> Closes #628
* Illumos #1888: zfs(8) should mention zfs recv -eBrian Behlendorf2012-08-101-5/+18
| | | | | | | | | | | | | Reviewed by: Garrett D'Amore <[email protected]> Reviewed by: Eric Schrock <[email protected]> Reviewed by: Gordon Ross <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/1888 Ported by: Brian Behlendorf <[email protected]> Closes #683
* Fix man page installation pathNed Bass2012-08-101-0/+1
| | | | | | | | | | | | | | | | | | | RPM versions 4.8 and 4.9 differ in the definition of macro %_mandir: $ rpm --version ; rpm --showrc | grep ^-14:._mandir RPM version 4.9.0 -14: _mandir %{_prefix}/share/man $ rpm --version ; rpm --showrc | grep ^-14:._mandir RPM version 4.8.0 -14: _mandir /usr/share/man zfs.spec.in defines %_prefix as /, so man pages end up getting installed in /share/man on RPM 4.9 systems. To fix this, define %_mandir relative to %_datadir in the spec file. Signed-off-by: Brian Behlendorf <[email protected]> Closes #353
* Export dbuf_* symbolsBrian Behlendorf2012-08-102-4/+33
| | | | | | | | | | | | | Export these symbols so they may be used by other ZFS consumers besides the ZPL. Remove three stale prototype definites from dbuf.h. The actual implementations of these functions were removed/renamed long ago. It would be good in the long term to remove the existing pragmas we inherited from Solaris and simply use the dbuf_* names. Signed-off-by: Brian Behlendorf <[email protected]>
* Support building a zfs-modules-dkms sub packagePrakash Surya2012-08-089-14/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for building a zfs-modules-dkms sub package built around Dynamic Kernel Module Support. This is to allow building packages using the DKMS infrastructure which is intended to ease the burden of kernel version changes, upgrades, etc. By default zfs-modules-dkms-* sub package will be built as part of the 'make rpm' target. Alternately, you can build only the DKMS module package using the 'make rpm-dkms' target. Examples: # To build packaged binaries as well as a dkms packages $ ./configure && make rpm # To build only the packaged binary utilities and dkms packages $ ./configure && make rpm-utils rpm-dkms Note: Only the RHEL 5/6, CHAOS 5, and Fedora distributions are supported for building the dkms sub package. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #535
* Add '--with-spl-timeout' optionPrakash Surya2012-08-082-39/+118
| | | | | | | | | | | | | | | | When checking for the SPL Module.symvers file, a timeout can now be passed in which will pause the configure step while it waits for this file to be generated. By default, the configure behavior is unchanged as a timeout of 0 is used. If a positive number of seconds is passed, configure will wait that number of seconds for the Module.symvers file before moving on. The main motivation for this change was to support parallel execution of './configure && make' for the SPL and ZFS packages in preparation of supporting DKMS based packages. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
* Illumos #1693: persistent 'comment' field for a zpoolDan McDonald2012-08-0810-28/+143
| | | | | | | | | | | | | Reviewed by: George Wilson <[email protected]> Reviewed by: Eric Schrock <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/1693 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #678
* Set zvol discard_granularity to the volblocksize.Etienne Dechamps2012-08-0761-0/+233
| | | | | | | | | | | | | | | | | | Currently, zvols have a discard granularity set to 0, which suggests to the upper layer that discard requests of arbirarily small size and alignment can be made efficiently. In practice however, ZFS does not handle unaligned discard requests efficiently: indeed, it is unable to free a part of a block. It will write zeros to the specified range instead, which is both useless and inefficient (see dnode_free_range). With this patch, zvol block devices expose volblocksize as their discard granularity, so the upper layer is aware that it's not supposed to send discard requests smaller than volblocksize. Signed-off-by: Brian Behlendorf <[email protected]> Closes #862
* Add missing dependencies to ./copy-builtinRichard Yao2012-08-061-0/+3
| | | | | | | | | | | | | | ZFS depends on EFI_PARTITION, ZLIB_DEFLATE and ZLIB_INFLATE, but when ZFS is integrated with the kernel source tree, menuconfig does not enforce these dependencies. This can cause build failures in the case of ZLIB_DEFLATE and ZLIB_INFLATE where symbols are not found. This can also cause runtime failures in the case of EFI_PARTITION, where the kernel will not understand GPT partitions when creating pools from raw disks. We solve this by making menuconfig aware of these dependencies. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #854
* Limit the number of blocks to discard at once.Etienne Dechamps2012-07-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The number of blocks that can be discarded in one BLKDISCARD ioctl on a zvol is currently unlimited. Some applications, such as mkfs, discard the whole volume at once and they use the maximum possible discard size to do that. As a result, several gigabytes discard requests are not uncommon. Unfortunately, if a large amount of data is allocated in the zvol, ZFS can be quite slow to process discard requests. This is especially true if the volblocksize is low (e.g. the 8K default). As a result, very large discard requests can take a very long time (seconds to minutes under heavy load) to complete. This can cause a number of problems, most notably if the zvol is accessed remotely (e.g. via iSCSI), in which case the client has a high probability of timing out on the request. This patch solves the issue by adding a new tunable module parameter: zvol_max_discard_blocks. This indicates the maximum possible range, in zvol blocks, of one discard operation. It is set by default to 16384 blocks, which appears to be a good tradeoff. Using the default volblocksize of 8K this is equivalent to 128 MB. When using the maximum volblocksize of 128K this is equivalent to 2 GB. Signed-off-by: Brian Behlendorf <[email protected]> Closes #858
* Illumos #1644, #1645, #1646, #1647, #1708Matthew Ahrens2012-07-3124-718/+2274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1644 add ZFS "clones" property 1645 add ZFS "written" and "written@..." properties 1646 "zfs send" should estimate size of stream 1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots 1708 adjust size of zpool history data References: https://www.illumos.org/issues/1644 https://www.illumos.org/issues/1645 https://www.illumos.org/issues/1646 https://www.illumos.org/issues/1647 https://www.illumos.org/issues/1708 This commit modifies the user to kernel space ioctl ABI. Extra care should be taken when updating to ensure both the kernel modules and utilities are updated. This change has reordered all of the new ioctl()s to the end of the list. This should help minimize this issue in the future. Reviewed by: Richard Lowe <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Garrett D'Amore <[email protected]> Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #826 Closes #664
* Adding grub2 mkconfig support patchManuel Amador (Rudd-O)2012-07-301-0/+31
| | | | | | | | Added simply for convenience until this, or an equivilant, change is merged in the upstream grub2 source. Signed-off-by: Brian Behlendorf <[email protected]> Issue #847
* Allow '-o remount' for non-legacy datasetsBrian Behlendorf2012-07-301-9/+9
| | | | | | | | | | | | This is done for compatibility with existing Linux infrastructure. In particular, when using zfs as a root filesystem there are init scripts which as part of shutdown remount root read-only. Also, the new systemd infrastructure being used by Fedora expects to be able to remount a file system read-write. Signed-off-by: Brian Behlendorf <[email protected]> Issue #847
* Merge branch 'builtin-clean'Brian Behlendorf2012-07-2629-959/+2767
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support in-tree builtin module building. These commits add support for compiling the ZFS module as a built-in kernel module by copying the module code into the kernel source tree. Here's the procedure: - Create your kernel configuration (`.config` file) as usual. This has to be done first so that ZFS's configure script is able to detect kernel features correctly. - Run `make prepare scripts` inside the kernel source tree. - Run `./configure --enable-linux-builtin --with-linux=/usr/src/linux-...` inside the ZFS directory. - Run `./copy-builtin /usr/src/linux-...` inside the ZFS directory. - In the kernel source tree, enable the `CONFIG_ZFS` option (e.g. using `make menuconfig`). Note that this option depends on `CONFIG_SPL` (see zfsonlinux/spl@744038069d3dc65e721b5b8cc5c37d8c7fcbd8c0). - Build the kernel as usual. ZFS module parameters can be set at boot time using the following syntax on the kernel command line: `zfs.parameter_name=parameter_value`. Note that you also need to rebuild the userspace tools (see zfsonlinux/zfs@f09398cec665259a4c2f96726680fbd3b0a3bac3). Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * Use /sys/module instead of /proc/modules.Etienne Dechamps2012-07-261-19/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When libzfs checks if the module is loaded or not, it currently reads /proc/modules and searches for a line matching the module name. Unfortunately, if the module is included in the kernel itself (built-in module), then /proc/modules won't list it, so libzfs will wrongly conclude that the module is not loaded, thus making all ZFS userspace tools unusable. Fortunately, all loaded modules appear as directories in /sys/module, even built-in ones. Thus we can use /sys/module in lieu of /proc/modules to fix the issue. As a bonus, the code for checking becomes much simpler. Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * Add script for builtin module building.Etienne Dechamps2012-07-269-31/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a "copy-builtin" script designed to prepare a kernel source tree for building ZFS as a builtin module. The script makes a full copy of all needed files, thus making the kernel source tree fully independent of the zfs source package. To achieve that, some compilation flags (-include, -I) have been moved to module/Makefile. This Makefile is only used when compiling external modules; when compiling builtin modules, a Kbuild file generated by the configure-builtin script is used instead. This makes sure Makefiles inside the kernel source tree does not contain references to the zfs source package. Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * When checking for symbol exports, try compiling.Etienne Dechamps2012-07-2613-592/+1839
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new autoconf function: ZFS_LINUX_TRY_COMPILE_SYMBOL. This new function does the following: - Call LINUX_TRY_COMPILE with the specified parameters. - If unsuccessful, return false. - If successful and we're configuring with --enable-linux-builtin, return true. - Else, call CHECK_SYMBOL_EXPORT with the specified parameters and return the result. All calls to CHECK_SYMBOL_EXPORT are converted to LINUX_TRY_COMPILE_SYMBOL so that the tests work even when configuring for builtin on a kernel which doesn't have loadable module support, or hasn't been built yet. Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * Fake modpost stage for LINUX_COMPILE.Etienne Dechamps2012-07-262-250/+500
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when building a test case, we're compiling an entire Linux module from beginning to end. This includes the MODPOST stage, which generates a "conftest.mod.c" file with some boilerplate module declaration code. This poses a problem when configuring for built-in on kernels which have loadable module support disabled. In this case conftest.mod.c is referencing disabled code, resulting in a compilation failure, thus breaking the tests. This patch fixes the issue by faking the modpost stage when the --enable-linux-builtin option is provided. It does so by forcing the modpost command to be /bin/true, and using an empty conftest.mod.c file. The test module still compiles fine, although the result isn't loadable, but we don't really care at this point. Note it is important to preserve the modpost stage when building out of tree. The ZFS_AC_KERNEL_BLK_END_REQUEST, ZFS_AC_KERNEL_BLK_QUEUE_FLUSH, and ZFS_AC_KERNEL_BLK_RQ_BYTES configure checks all depend on it to identify GPL-only symbols. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * Make configure builtin-aware.Etienne Dechamps2012-07-263-28/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new option to configure: --enable-linux-builtin. When this option is used, the following happens: - Compilation of kernel modules is disabled. - A failure to find UTS_RELEASE is followed by a suggestion to run "make prepare" on the kernel source tree. This patch also adds a new test which tries to compile an empty module as a basic toolchain sanity test. If it fails and the option was specified, the error is followed by a suggestion to run "make scripts" on the kernel source tree. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
| * Don't build packages that haven't been selected.Etienne Dechamps2012-07-265-43/+59
|/ | | | | | | | | | | Currently, when configure --with-config is used, selective compilation is only effective for the simple "make" case. Package builders (e.g. make rpm) still build everything (utils and modules). This patch fixes that. Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #851
* Linux 3.5 compat, end_writeback() changed to clear_inode()Richard Yao2012-07-2361-5/+214
| | | | | | | | | | | | | | | | The end_writeback() function was changed by moving the call to inode_sync_wait() earlier in to evict(). This effecitvely changes the ordering of the sync but it does not impact the details of the zfs implementation. However, as part of this change end_writeback() was renamed to clear_inode() to reflect the new semantics. This change does impact us and clear_inode() now maps to end_writeback() for kernels prior to 3.5. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #784
* Linux 3.5 compat, iops->truncate_range() removedRichard Yao2012-07-2360-0/+225
| | | | | | | | | The vmtruncate_range() support has been removed from the kernel in favor of using the fallocate method in the file_operations table. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #784
* Linux 3.5 compat, eops->encode_fh() takes inodesRichard Yao2012-07-2360-1/+227
| | | | | | | | | | | | | | The export_operations member ->encode_fh() has been updated to take both the child and parent inodes. This interface used to take the child dentry and a bool describing if the parent is needed. NOTE: While updating this code I noticed that we do not currently cleanly handle the case where we're passed a connectable parent. This code should be audited to make sure we're doing the right thing. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #784
* Fix NULL pointer dereference on PaX/GRSecurity patched Linux 3.3 and later ↵Richard Yao2012-07-202-12/+15
| | | | | | | | | | | | | | | kernels Support for PaX/GRSecurity patched kernels was developed against Linux 3.2. Unfortunately, an autotools check introduced for a Linux 3.3 API fails on PaX/GRSecurity patched kernels. This causes the module to be built against the Linux 3.2 ABI, which results in a NULL pointer dereference at runtime. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #794 Closes #809