]> git.proxmox.com Git - mirror_spl-debian.git/log
mirror_spl-debian.git
12 years agoMerge branch 'upstream'
Darik Horn [Fri, 23 Dec 2011 13:19:00 +0000 (07:19 -0600)]
Merge branch 'upstream'

12 years agoProxmox VE kernel compat, invalidate_inodes()
Brian Behlendorf [Wed, 21 Dec 2011 22:22:45 +0000 (14:22 -0800)]
Proxmox VE kernel compat, invalidate_inodes()

The Proxmox VE kernel contains a patch which renames the function
invalidate_inodes() to invalidate_inodes_check().  In the process
it adds a 'check' argument and a '#define invalidate_inodes(x)'
compatibility wrapper for legacy callers.  Therefore, if either
of these functions are exported invalidate_inodes() can be
safely used.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #58

12 years agoMove Arch Linux's VENDOR check above Ubuntu's
Prakash Surya [Sat, 17 Dec 2011 06:16:47 +0000 (22:16 -0800)]
Move Arch Linux's VENDOR check above Ubuntu's

If the lsb-release package is installed on an Arch Linux distribution,
the configure step will incorrectly detect the running distribution as
Ubuntu. This is a result of both distributions providing an
/etc/lsb-release file, and the Ubuntu VENDOR check being performed
first.

Since the Arch Linux test check's for a file more specific to the Arch
Linux distribution, moving Arch Linux's VENDOR check above Unbuntu's
check provides a quick and easy solution.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #72

12 years agoStore copy of tqent_flags prior to servicing task
Prakash Surya [Fri, 16 Dec 2011 22:57:31 +0000 (14:57 -0800)]
Store copy of tqent_flags prior to servicing task

A preallocated taskq_ent_t's tqent_flags must be checked prior to
servicing the taskq_ent_t. Once a preallocated taskq entry is serviced,
the ownership of the entry is handed back to the caller of
taskq_dispatch, thus the entry's contents can potentially be mangled.

In particular, this is a problem in the case where a preallocated taskq
entry is serviced, and the caller clears it's tqent_flags field. Thus,
when the function returns and task_done is called, it looks as though
the entry is **not** a preallocated task (when in fact it **is** a
preallocated task).

In this situation, task_done will place the preallocated taskq_ent_t
structure onto the taskq_t's free list. This is a **huge** mistake. If
the taskq_ent_t is then freed by the caller of taskq_dispatch, the
taskq_t's free list will hold a pointer to garbage data. Even worse, if
nothing has over written the freed memory before the pointer is
dereferenced, it may still look as though it points to a valid list_head
belonging to a taskq_ent_t structure.

Thus, the task entry's flags are now copied prior to servicing the task.
This copy is then checked to see if it is a preallocated task, and
determine if the entry needs to be passed down to the task_done
function.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #71

12 years agoSwap taskq_ent_t with taskqid_t in taskq_thread_t
Prakash Surya [Fri, 16 Dec 2011 17:44:31 +0000 (09:44 -0800)]
Swap taskq_ent_t with taskqid_t in taskq_thread_t

The taskq_t's active thread list is sorted based on its
tqt_ent->tqent_id field. The list is kept sorted solely by inserting
new taskq_thread_t's in their correct sorted location; no other
means is used. This means that once inserted, if a taskq_thread_t's
tqt_ent->tqent_id field changes, the list runs the risk of no
longer being sorted.

Prior to the introduction of the taskq_dispatch_prealloc() interface,
this was not a problem as a taskq_ent_t actively being serviced under
the old interface should always have a static tqent_id field. Thus,
once the taskq_thread_t is added to the taskq_t's active thread list,
the taskq_thread_t's tqt_ent->tqent_id field would remain constant.

Now, this is no longer the case. Currently, if using the
taskq_dispatch_prealloc() interface, any given taskq_ent_t actively
being serviced _may_ have its tqent_id value incremented. This happens
when the preallocated taskq_ent_t structure is recursively dispatched.
Thus, a taskq_thread_t could potentially have its tqt_ent->tqent_id
field silently modified from under its feet. If this were to happen
to a taskq_thread_t on a taskq_t's active thread list, this would
compromise the integrity of the order of the list (as the list
_may_ no longer be sorted).

To get around this, the taskq_thread_t's taskq_ent_t pointer was
replaced with its own static copy of the tqent_id. So, as a taskq_ent_t
is pulled off of the taskq_t's pending list, a static copy of its
tqent_id is made and this copy is used to sort the active thread
list. Using a static copy is key in ensuring the integrity of the
order of the active thread list. Even if the underlying taskq_ent_t
is recursively dispatched (as has its tqent_id modified), this
static copy stored inside the taskq_thread_t will remain constant.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #71

12 years agoPPA 0.6.0.41-0ubuntu1 release.
Darik Horn [Thu, 15 Dec 2011 16:08:17 +0000 (10:08 -0600)]
PPA 0.6.0.41-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Thu, 15 Dec 2011 16:05:04 +0000 (10:05 -0600)]
Merge branch 'upstream'

12 years agoAdd make rule for building Arch Linux packages
Prakash Surya [Wed, 7 Dec 2011 01:33:51 +0000 (17:33 -0800)]
Add make rule for building Arch Linux packages

Added the necessary build infrastructure for building packages
compatible with the Arch Linux distribution. As such, one can now run:

    $ ./configure
    $ make pkg     # Alternatively, one can run 'make arch' as well

on an Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the spl userland utilties and
another for the spl kernel modules. The new packages can then be
installed by running:

    # pacman -U $package.pkg.tar.xz

In addition, source-only packages suitable for an Arch Linux chroot
environment or remote builder can also be built using the 'sarch' make
rule.

NOTE: Since the source dist tarball is created on the fly from the head
of the build tree, it's MD5 hash signature will be continually influx.
As a result, the md5sum variable was intentionally omitted from the
PKGBUILD files, and the '--skipinteg' makepkg option is used. This may
or may not have any serious security implications, as the source tarball
is not being downloaded from an outside source.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #68
12 years agoMerge branch 'upstream'
Darik Horn [Wed, 14 Dec 2011 02:39:47 +0000 (20:39 -0600)]
Merge branch 'upstream'

12 years agoExercise new taskq interface in splat-taskq tests
Prakash Surya [Tue, 6 Dec 2011 18:11:36 +0000 (10:11 -0800)]
Exercise new taskq interface in splat-taskq tests

The splat-taskq test functions were slightly modified to exercise
the new taskq interface in addition to the old interface.  If the
old interface passes each of its tests, the new interface is
exercised.  Both sub tests (old interface and new interface) must
pass for each test as a whole to pass.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #65

12 years agoImplement taskq_dispatch_prealloc() interface
Prakash Surya [Tue, 6 Dec 2011 18:04:51 +0000 (10:04 -0800)]
Implement taskq_dispatch_prealloc() interface

This patch implements the taskq_dispatch_prealloc() interface which
was introduced by the following illumos-gate commit.  It allows for
a preallocated taskq_ent_t to be used when dispatching items to a
taskq.  This eliminates a memory allocation which helps minimize
lock contention in the taskq when dispatching functions.

    commit 5aeb94743e3be0c51e86f73096334611ae3a058e
    Author: Garrett D'Amore <garrett@nexenta.com>
    Date:   Wed Jul 27 07:13:44 2011 -0700

    734 taskq_dispatch_prealloc() desired
    943 zio_interrupt ends up calling taskq_dispatch with TQ_SLEEP

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoAdd Test: "Single task queue, recursive dispatch"
Prakash Surya [Tue, 6 Dec 2011 17:48:06 +0000 (09:48 -0800)]
Add Test: "Single task queue, recursive dispatch"

Added another splat taskq test to ensure tasks can be recursively
submitted to a single task queue without issue. When the
taskq_dispatch_prealloc() interface is introduced, this use case
can potentially cause a deadlock if a taskq_ent_t is dispatched
while its tqent_list field is not empty. This _should_ never be
a problem with the existing taskq_dispatch() interface.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoReplace tq_work_list and tq_threads in taskq_t
Prakash Surya [Tue, 6 Dec 2011 01:32:48 +0000 (17:32 -0800)]
Replace tq_work_list and tq_threads in taskq_t

To lay the ground work for introducing the taskq_dispatch_prealloc()
interface, the tq_work_list and tq_threads fields had to be replaced
with new alternatives in the taskq_t structure.

The tq_threads field was replaced with tq_thread_list. Rather than
storing the pointers to the taskq's kernel threads in an array, they are
now stored as a list. In addition to laying the ground work for the
taskq_dispatch_prealloc() interface, this change could also enable taskq
threads to be dynamically created and destroyed as threads can now be
added and removed to this list relatively easily.

The tq_work_list field was replaced with tq_active_list. Instead of
keeping a list of taskq_ent_t's which are currently being serviced, a
list of taskq_threads currently servicing a taskq_ent_t is kept. This
frees up the taskq_ent_t's tqent_list field when it is being serviced
(i.e. now when a taskq_ent_t is being serviced, it's tqent_list field
will be empty).

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoReplace struct spl_task with struct taskq_ent
Prakash Surya [Fri, 11 Nov 2011 23:06:35 +0000 (15:06 -0800)]
Replace struct spl_task with struct taskq_ent

The spl_task structure was renamed to taskq_ent, and all of
its fields were renamed to have a prefix of 'tqent' rather
than 't'. This was to align with the naming convention which
the ZFS code assumes.  Previously these fields were private
so the name never mattered.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #65

12 years agoAdd SPLAT_TEST_FINI call for SPLAT_TASKQ_TEST6_ID
Prakash Surya [Fri, 2 Dec 2011 22:05:06 +0000 (14:05 -0800)]
Add SPLAT_TEST_FINI call for SPLAT_TASKQ_TEST6_ID

This change adds the neglected SPLAT_TEST_FINI call for the
SPLAT_TASKQ_TEST6_ID, just as is done for the other 5 SPLAT_TASKQ_*
tests.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #64

12 years agoFix usage of MUTEX macro in mutex_enter_nested
Prakash Surya [Mon, 12 Dec 2011 23:37:30 +0000 (15:37 -0800)]
Fix usage of MUTEX macro in mutex_enter_nested

A call site of the MUTEX macro had incorrectly placed its closing
parenthesis, causing two parameters to be passed rather than one. This
change moves the misplaced parenthesis to fix the typographical error.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #70

12 years agoAllow 64-bit timestamps to be set on 64-bit kernels
Chris Dunlop [Tue, 6 Dec 2011 04:29:58 +0000 (15:29 +1100)]
Allow 64-bit timestamps to be set on 64-bit kernels

ZFS and 64-bit linux are perfectly capable of dealing with 64-bit
timestamps, but ZFS deliberately prevents setting them.  Adjust
the SPL such that TIMESPEC_OVERFLOW will not always assume 32-bit
values and instead use the correct values for your kernel build.
This effectively allows 64-bit timestamps on 64-bit systems.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #487

12 years agoPPA 0.6.0.40-0ubuntu1 release.
Darik Horn [Tue, 6 Dec 2011 02:06:24 +0000 (20:06 -0600)]
PPA 0.6.0.40-0ubuntu1 release.

12 years agoPPA 0.6.0.39-0ubuntu1 release.
Darik Horn [Tue, 22 Nov 2011 14:31:50 +0000 (08:31 -0600)]
PPA 0.6.0.39-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 22 Nov 2011 14:30:03 +0000 (08:30 -0600)]
Merge branch 'upstream'

12 years agoFix a typo referencing an incorrect symbol
Prakash Surya [Fri, 18 Nov 2011 22:27:37 +0000 (14:27 -0800)]
Fix a typo referencing an incorrect symbol

The splat_taskq_test4_common function was incorrectly referencing
the splat_taskq-test13_func symbol, when it meant to be using the
splat_taskq_test4_func symbol.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #61

12 years agoPrepend spl_ to all init/fini functions
Brian Behlendorf [Fri, 11 Nov 2011 17:03:31 +0000 (09:03 -0800)]
Prepend spl_ to all init/fini functions

This is a bit of cleanup I'd been meaning to get to for a while
to reduce the chance of a type conflict.  Well that conflict
finally occurred with the kstat_init() function which conflicts
with a function in the 2.6.32-6-pve kernel.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #56

12 years agoPPA 0.6.0.38-0ubuntu1 release.
Darik Horn [Fri, 11 Nov 2011 14:58:24 +0000 (08:58 -0600)]
PPA 0.6.0.38-0ubuntu1 release.

12 years agoRefresh debian/patches after upstream merge.
Darik Horn [Fri, 11 Nov 2011 14:54:57 +0000 (08:54 -0600)]
Refresh debian/patches after upstream merge.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 11 Nov 2011 14:51:45 +0000 (08:51 -0600)]
Merge branch 'upstream'

12 years agoFix depmod warning
Brian Behlendorf [Thu, 10 Nov 2011 18:36:21 +0000 (10:36 -0800)]
Fix depmod warning

The depmod utility from module-init-tools 3.12-pre3 generates a
warning when the -e option is used without -E or -F.  This was
observed under OpenSuse 11.4.  To resolve the issue when the
exact System.map-* for your kernel cannot be found fallback to
a generic safe '/sbin/depmod -a'.

  WARNING: -e needs -E or -F

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoLinux 3.1 compat, shrink_*cache_memory
Brian Behlendorf [Thu, 10 Nov 2011 00:31:03 +0000 (16:31 -0800)]
Linux 3.1 compat, shrink_*cache_memory

As of Linux 3.1 the shrink_dcache_memory and shrink_icache_memory
functions have been removed.  This same task is now accomplished
more cleanly with per super block shrinkers.  This unfortunately
leaves us no easy way to support the dnlc_reduce_cache() function.

This support has always been entirely optional.  So when no
reasonable interface is available allow the dnlc_reduce_cache()
function to effectively become a no-op.

The downside of this change is that it will prevent the zfs arc
meta data limts from being enforced.  However, the current zfs
implementation in this regard is already flawed and needs to
be reworked.  If the arc needs to enfore a meta data limit it
will need to be extended to coordinate directly with the zpl.
This will allow us to drop all this compatibility code and get
more fine grained control over the cache management.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoLinux 3.1 compat, vfs_fsync()
Brian Behlendorf [Wed, 9 Nov 2011 20:45:35 +0000 (12:45 -0800)]
Linux 3.1 compat, vfs_fsync()

Preferentially use the vfs_fsync() function.  This function was
initially introduced in 2.6.29 and took three arguments.  As
of 2.6.35 the dentry argument was dropped from the function.
For older kernels fall back to using file_fsync() which also
took three arguments including the dentry.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoLinux 3.1 compat, kern_path_parent()
Brian Behlendorf [Wed, 9 Nov 2011 20:29:51 +0000 (12:29 -0800)]
Linux 3.1 compat, kern_path_parent()

Prior to Linux 3.1 the kern_path_parent symbol was exported for
use by kernel modules.  As of Linux 3.1 it is now longer easily
available.  To handle this case the spl will now dynamically
look up address of the missing symbol at module load time.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #52

12 years agoPPA 0.6.0.37-0ubuntu1 release.
Darik Horn [Sat, 5 Nov 2011 15:25:00 +0000 (10:25 -0500)]
PPA 0.6.0.37-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 5 Nov 2011 15:24:02 +0000 (10:24 -0500)]
Merge branch 'upstream'

12 years agoFix NULL deref in balance_pgdat()
Brian Behlendorf [Tue, 1 Nov 2011 20:35:12 +0000 (13:35 -0700)]
Fix NULL deref in balance_pgdat()

Be careful not to unconditionally clear the PF_MEMALLOC bit in
the task structure.  It may have already been set when entering
kv_alloc() in which case it must remain set on exit.  In
particular the kswapd thread will have PF_MEMALLOC set in
order to prevent it from entering direct reclaim.  By clearing
it we allow the following NULL deref to potentially occur.

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: [<ffffffff8109c7ab>] balance_pgdat+0x25b/0x4ff

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #287

12 years agoPPA 0.6.0.36-0ubuntu1 release.
Darik Horn [Sat, 29 Oct 2011 00:34:23 +0000 (19:34 -0500)]
PPA 0.6.0.36-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Sat, 29 Oct 2011 00:32:23 +0000 (19:32 -0500)]
Merge branch 'upstream'

12 years agoRemove redundant postinst and prerm boilerplate.
Darik Horn [Fri, 21 Oct 2011 22:27:01 +0000 (17:27 -0500)]
Remove redundant postinst and prerm boilerplate.

Remove scripting that is automatically added by the dh_dkms helper.

12 years agoMinor typo correction and comment updates.
Darik Horn [Fri, 21 Oct 2011 22:21:25 +0000 (17:21 -0500)]
Minor typo correction and comment updates.

12 years agoPPA 0.6.0.35-0ubuntu2 release.
Darik Horn [Wed, 19 Oct 2011 23:03:35 +0000 (18:03 -0500)]
PPA 0.6.0.35-0ubuntu2 release.

Increment the META version. The previous build was bad because the
volatile-version.patch was not updated, which caused this error:

  Setting up spl-dkms (0.6.0.35-0ubuntu1~oneiric1) ...
  First Installation: checking all kernels...
  Building only for 3.0.0-12-generic
  This package appears to be a binaries-only package
   you will not be able to build against kernel 3.0.0-12-generic
   since the package source was not provided

12 years agoPPA 0.6.0.35-0ubuntu1 release.
Darik Horn [Wed, 19 Oct 2011 19:17:17 +0000 (14:17 -0500)]
PPA 0.6.0.35-0ubuntu1 release.

12 years agoInclude distribution in release
Brian Behlendorf [Wed, 19 Oct 2011 18:23:38 +0000 (11:23 -0700)]
Include distribution in release

Common practice is to include the distribution in the package release.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoRemove tentative gunnarbeutner/bug-391 patch.
Darik Horn [Wed, 19 Oct 2011 18:26:47 +0000 (13:26 -0500)]
Remove tentative gunnarbeutner/bug-391 patch.

This patch was merged upstream.

12 years agoMerge branch 'upstream'
Darik Horn [Wed, 19 Oct 2011 18:25:37 +0000 (13:25 -0500)]
Merge branch 'upstream'

12 years agoCleaned up MUTEX() #define
Gunnar Beutner [Wed, 19 Oct 2011 16:04:40 +0000 (18:04 +0200)]
Cleaned up MUTEX() #define

The old define assumed a specific layout of the kmutex_t struct. This
patch makes the macro independent from the actual struct layout.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoRemove the spinlocks for mutex_enter()/mutex_exit()
Gunnar Beutner [Tue, 18 Oct 2011 00:54:35 +0000 (02:54 +0200)]
Remove the spinlocks for mutex_enter()/mutex_exit()

The m_owner variable is protected by the mutex itself. Reading the variable
is guaranteed to be atomic (due to it being a word-sized reference) and
ACCESS_ONCE() takes care of read cache effects.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFix race condition in mutex_exit()
Gunnar Beutner [Tue, 18 Oct 2011 00:32:50 +0000 (02:32 +0200)]
Fix race condition in mutex_exit()

On kernels with CONFIG_DEBUG_MUTEXES mutex_exit() clears the mutex
owner after releasing the mutex. This would cause mutex_owner()
to return an incorrect owner if another thread managed to lock the
mutex before mutex_exit() had a chance to clear the owner.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #167

12 years agovn_rdwr() didn't properly advance the file position
Gunnar Beutner [Wed, 12 Oct 2011 10:49:18 +0000 (12:49 +0200)]
vn_rdwr() didn't properly advance the file position

This would cause problems when using 'zfs send' with a file as the
target (rather than a pipe or a socket as is usually the case) as
for each write the destination offset in the file would be 0.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #391

12 years agoFix package URLs to use the github repository
Brian Behlendorf [Mon, 17 Oct 2011 23:40:38 +0000 (16:40 -0700)]
Fix package URLs to use the github repository

The URL field in the spl-modules and spl package spec files were
updated to point to the ZFS on Linux repository hosted by github.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoAdd tentative gunnarbeutner/bug-391 patch.
Darik Horn [Mon, 17 Oct 2011 19:16:39 +0000 (14:16 -0500)]
Add tentative gunnarbeutner/bug-391 patch.

vn_rdwr() didn't properly advance the file position

This would cause problems when using 'zfs send' with a file as the
target (rather than a pipe or a socket as is usually the case) as
for each write the destination offset in the file would be 0.

12 years agoPPA 0.6.0.34-0ubuntu1 release.
Darik Horn [Wed, 12 Oct 2011 00:09:27 +0000 (19:09 -0500)]
PPA 0.6.0.34-0ubuntu1 release.

Also fix a typo in the changelog entry for the earlier
PPA 0.6.0.31-0ubuntu1 release.

12 years agoAdd the hostid-stabilize branch as DEB patches.
Darik Horn [Tue, 11 Oct 2011 23:56:51 +0000 (18:56 -0500)]
Add the hostid-stabilize branch as DEB patches.

Continue to stabilize the /etc/hostid file for all DEB installations.

The unstable hostid glitch was happening on Debian and Ubuntu systems
before a similar fix was added to the upstream RPM spec.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 11 Oct 2011 20:29:40 +0000 (15:29 -0500)]
Merge branch 'upstream'

12 years agoFix various typos in comments
Brian Behlendorf [Tue, 11 Oct 2011 17:11:26 +0000 (10:11 -0700)]
Fix various typos in comments

Just clean up some of the typos and spelling mistakes in the
comments of spl-kmem.c.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoFixed typo in spl_slab_alloc()
Gunnar Beutner [Tue, 11 Oct 2011 17:03:29 +0000 (10:03 -0700)]
Fixed typo in spl_slab_alloc()

The typo did not have any effect (apart from a negligible performance
impact) because skc->skc_flags * KMC_OFFSLAB is always non-null when
at least one bit in skc->skc_flags is set.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoProperly destroy work items in spl_kmem_cache_destroy()
Gunnar Beutner [Tue, 11 Oct 2011 16:59:02 +0000 (09:59 -0700)]
Properly destroy work items in spl_kmem_cache_destroy()

In a non-debug build the ASSERT() would be optimized away
which could cause pending work items to not be cancelled.

We must also use cancel_delayed_work_sync() rather than just
cancel_delayed_work() to actually wait until work items have
completed.  Otherwise they might accidentally access free'd
memory.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS bugs #279, #62, #363, #418

12 years agoFixed invalid resource re-use in file_find()
Gunnar Beutner [Tue, 11 Oct 2011 16:50:52 +0000 (09:50 -0700)]
Fixed invalid resource re-use in file_find()

File descriptors are a per-process resource. The same descriptor
in different processes can refer to different files. find_file()
incorrectly assumed that file descriptors are globally unique.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes ZFS issue #386

12 years agoPrep spl-0.6.0-rc6 tag
Brian Behlendorf [Thu, 6 Oct 2011 21:07:00 +0000 (14:07 -0700)]
Prep spl-0.6.0-rc6 tag

Create the sixth 0.6.0 release candidate tag (rc6).

12 years agoRemove /etc/hostid missing warning
Brian Behlendorf [Thu, 6 Oct 2011 21:55:17 +0000 (14:55 -0700)]
Remove /etc/hostid missing warning

No longer print the following warning to the console when the
/etc/hostid file is missing.  This is the expected default behavior.
Keeping the hostid in sync with the initramfs is now accomplished
by creating the /etc/hostid in the initramfs not on the system.

  SPL: The /etc/hostid file is not found.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoRevert "Stabilize the hostid for RPM installations."
Brian Behlendorf [Fri, 30 Sep 2011 16:36:35 +0000 (09:36 -0700)]
Revert "Stabilize the hostid for RPM installations."

Creating an /etc/hostid file as part of the rpm post install
causes problems for diskless systems which are sharing an image.
While it's still critical to ensure the hostid doesn't change
for zfs root filesystems.  This will now be done by setting
the /etc/hostid in the initramfs created by dracut.

This reverts commit 79593b0dec57ee94c5bb56cdc2770ebde81ecea9.

12 years agoPPA 0.6.0.33-0ubuntu1 release.
Darik Horn [Thu, 29 Sep 2011 03:34:19 +0000 (22:34 -0500)]
PPA 0.6.0.33-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Thu, 29 Sep 2011 03:32:01 +0000 (22:32 -0500)]
Merge branch 'upstream'

12 years agoFix HAVE_FS_STRUCT_SPINLOCK check for gcc-4.1.2
Brian Behlendorf [Mon, 19 Sep 2011 20:35:03 +0000 (13:35 -0700)]
Fix HAVE_FS_STRUCT_SPINLOCK check for gcc-4.1.2

Older versions of gcc (gcc-4.1.2) will treat an 'incompatible
pointer type' as a warning instead of an error.  This results
in HAVE_FS_STRUCT_SPINLOCK being defined incorrectly.  This
failure mode was observed when using a RHEL6 2.6.32 based kernel
under RHEL5.5 which contains the old version of gcc.  To resolve
the issue the warning is explicitly promoted to an error.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
12 years agoPPA 0.6.0.32-0ubuntu1 release.
Darik Horn [Sat, 10 Sep 2011 01:35:45 +0000 (20:35 -0500)]
PPA 0.6.0.32-0ubuntu1 release.

12 years agoPPA 0.6.0.31-0ubuntu1 release.
Darik Horn [Fri, 19 Aug 2011 18:05:13 +0000 (13:05 -0500)]
PPA 0.6.0.31-0ubuntu1 release.

12 years agoPPA 0.6.0.30-0ubuntu1 release.
Darik Horn [Tue, 9 Aug 2011 05:44:51 +0000 (00:44 -0500)]
PPA 0.6.0.30-0ubuntu1 release.

12 years agoPPA 0.6.0.29-0ubuntu1 release.
Darik Horn [Tue, 2 Aug 2011 15:06:51 +0000 (10:06 -0500)]
PPA 0.6.0.29-0ubuntu1 release.

12 years agoPPA 0.6.0.28-0ubuntu1 release.
Darik Horn [Tue, 26 Jul 2011 04:02:28 +0000 (23:02 -0500)]
PPA 0.6.0.28-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Tue, 26 Jul 2011 04:00:47 +0000 (23:00 -0500)]
Merge branch 'upstream'

12 years agoFix the configure CONFIG_* option detection
Brian Behlendorf [Fri, 22 Jul 2011 21:23:12 +0000 (14:23 -0700)]
Fix the configure CONFIG_* option detection

The latest kernels no longer define AUTOCONF_INCLUDED which was
being used to detect the new style autoconf.h kernel configure
options.  This results in the CONFIG_* checks always failing
incorrectly for newer kernels.

The fix for this is a simplification of the testing method.
Rather than attempting to explicitly include to renamed config
header.  It is simpler to unconditionally include <linux/module.h>
which must pick up the correctly named header.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #320

12 years agoPPA 0.6.0.27-0ubuntu1 release.
Darik Horn [Fri, 22 Jul 2011 19:45:16 +0000 (14:45 -0500)]
PPA 0.6.0.27-0ubuntu1 release.

12 years agoPPA 0.6.0.26-0ubuntu1 release.
Darik Horn [Wed, 20 Jul 2011 20:38:19 +0000 (15:38 -0500)]
PPA 0.6.0.26-0ubuntu1 release.

12 years agoMerge branch 'upstream'
Darik Horn [Wed, 20 Jul 2011 20:36:34 +0000 (15:36 -0500)]
Merge branch 'upstream'

12 years agoFix 'make install' overly broad 'rm'
Brian Behlendorf [Wed, 20 Jul 2011 04:06:50 +0000 (21:06 -0700)]
Fix 'make install' overly broad 'rm'

When running 'make install' without DESTDIR set the module install
rules would mistakenly destroy the 'modules.*' files for ALL of
your installed kernels.  This could lead to a non-functional system
for the alternate kernels because 'depmod -a' will only be run for
the kernel which was compiled against.  This issue would not impact
anyone using the 'make <deb|rpm|pkg>' build targets to build and
install packages.

The fix for this issue is to only remove extraneous build products
when DESTDIR is set.  This almost exclusively indicates we are
building packages and installed the build products in to a temporary
staging location.  Additionally, limit the removal the unneeded
build products to the target kernel version.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #328

12 years agoPPA 0.6.0.25.rc5 release, spl-0.6.0-rc5 upstream.
Darik Horn [Wed, 13 Jul 2011 00:24:47 +0000 (19:24 -0500)]
PPA 0.6.0.25.rc5 release, spl-0.6.0-rc5 upstream.

12 years agoPPA 0.6.0.24.rc5 release, Oneiric topic branch.
Darik Horn [Tue, 12 Jul 2011 01:55:40 +0000 (20:55 -0500)]
PPA 0.6.0.24.rc5 release, Oneiric topic branch.

12 years agoPPA 0.6.0.23.rc5 release, Oneiric topic branch.
Darik Horn [Fri, 8 Jul 2011 02:14:20 +0000 (21:14 -0500)]
PPA 0.6.0.23.rc5 release, Oneiric topic branch.

12 years agoUse 0.6.0.22.rc5 as the unofficial version.
Darik Horn [Sun, 3 Jul 2011 18:00:05 +0000 (13:00 -0500)]
Use 0.6.0.22.rc5 as the unofficial version.

12 years agoMerge branch 'upstream'
Darik Horn [Sun, 3 Jul 2011 17:58:43 +0000 (12:58 -0500)]
Merge branch 'upstream'

12 years agoPrep spl-0.6.0-rc5 tag
Brian Behlendorf [Fri, 1 Jul 2011 22:23:17 +0000 (15:23 -0700)]
Prep spl-0.6.0-rc5 tag

Create the fifth 0.6.0 release candidate tag (rc5).

12 years agoUse 0.6.0.21 as the unofficial version.
Darik Horn [Fri, 1 Jul 2011 16:35:56 +0000 (11:35 -0500)]
Use 0.6.0.21 as the unofficial version.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 1 Jul 2011 16:35:18 +0000 (11:35 -0500)]
Merge branch 'upstream'

12 years agoLinux 2.6.39 compat, mutex owner
Brian Behlendorf [Fri, 24 Jun 2011 18:57:14 +0000 (11:57 -0700)]
Linux 2.6.39 compat, mutex owner

Prior to Linux 2.6.39 when CONFIG_DEBUG_MUTEXES was defined
the kernel stored a thread_info pointer as the mutex owner.
From this you could get the pointer of the current task_struct
to compare with get_current().

As of Linux 2.6.39 this behavior has changed and now the mutex
stores a pointer to the task_struct.  This commit detects the
type of pointer stored in the mutex and adjusts the mutex_owner()
and mutex_owned() functions to perform the correct comparision.

12 years agoUse 0.6.0.20 as the unofficial version.
Darik Horn [Fri, 24 Jun 2011 18:44:11 +0000 (13:44 -0500)]
Use 0.6.0.20 as the unofficial version.

12 years agoMerge branch 'upstream'
Darik Horn [Fri, 24 Jun 2011 18:42:08 +0000 (13:42 -0500)]
Merge branch 'upstream'

12 years agoStabilize the hostid for RPM installations.
Darik Horn [Fri, 24 Jun 2011 03:10:27 +0000 (22:10 -0500)]
Stabilize the hostid for RPM installations.

ZFS requires a stable hostid to recognize foreign pool imports,
but the hostid of a Linux system can change if the /etc/hostid
file is missing, particularly during DHCP lease updates.

Ensure that the system hostid is stable by creating the
/etc/hostid file from the output of the /usr/bin/hostid utility.
The /sbin/genhostid utility that is provided by the initscripts
package is not used because it creates a random hostid, which
breaks upgrades on systems that already have the SPL module
installed.

The external `printf` is used because the dash builtin lacks
the byte format.  Conveniences like a ${HOSTID:$ii:2} substring
range or a `sed` one-liner are similarly avoided.

12 years agoRead the /etc/hostid file directly.
Darik Horn [Mon, 20 Jun 2011 19:53:56 +0000 (14:53 -0500)]
Read the /etc/hostid file directly.

Deprecate the /usr/bin/hostid call by reading the /etc/hostid file
directly. Add the spl_hostid_path parameter to override the default
/etc/hostid path.

Rename the set_hostid() function to hostid_exec() to better reflect
actual behavior and complement the new hostid_read() function.

Use HW_INVALID_HOSTID as the spl_hostid sentinel value because
zero seems to be a valid gethostid() result on Linux.

12 years agoAdd linux compatibility tests
Brian Behlendorf [Tue, 21 Jun 2011 17:57:48 +0000 (10:57 -0700)]
Add linux compatibility tests

While the splat tests were originally designed to stress test
the Solaris primatives.  I am extending them to include some kernel
compatibility tests.  Certain linux APIs have changed frequently.
These tests ensure that added compatibility is working properly
and no unnoticed regression have slipped in.

Test 1 and 2 add basic regression tests for shrink_icache_memory
and shrink_dcache_memory.  These are simply functional tests to
ensure we can call these functions safely.  Checking for correct
behavior is more difficult since other running processes will
influence the behavior.  However, these functions are provided
by the kernel so if we can successfully call them we assume they
are working correctly.

Test 3 checks that shrinker functions are being registered and
called correctly.  As of Linux 3.0 the shrinker API has changed
four different times so I felt the need to add a trivial test
case to ensure each variant works as expected.

12 years agoLinux 3.0: Shrinker compatibility
Brian Behlendorf [Thu, 16 Jun 2011 22:39:08 +0000 (15:39 -0700)]
Linux 3.0: Shrinker compatibility

Update the the wrapper macros for the memory shrinker to handle
this 4th API change.  The callback function now takes a
shrink_control structure.  This is certainly a step in the
right direction but it's annoying to have to accomidate yet
another version of the API.

12 years agoUse 0.6.0.19 as the unofficial version.
Darik Horn [Sun, 19 Jun 2011 17:31:20 +0000 (12:31 -0500)]
Use 0.6.0.19 as the unofficial version.

12 years agoDepend on the lsb-release package.
Darik Horn [Fri, 17 Jun 2011 19:06:51 +0000 (14:06 -0500)]
Depend on the lsb-release package.

The dkms.conf file uses lsb_release to set a configuration parameter,
but this utility is not provided by a base package on Debian systems.

On Ubuntu systems, lsb-release is installed as a dependency of the
ubuntu-minimal metapackage.

Closes dajhorn/pkg-zfs#3.

12 years agoAvoid 'rpm -q' bug for 'make pkg'
Brian Behlendorf [Thu, 16 Jun 2011 18:49:38 +0000 (11:49 -0700)]
Avoid 'rpm -q' bug for 'make pkg'

RPM version 4.9.0 has been observed to generate extra debug
messages in certain cases.  These debug messages prevent us
from cleanly acquiring the architecture.  This is clearly
an upstream RPM bug which will get fixed.  But until then
a safe solution is to pipe the result through 'tail -1'
to just grab the architecture bit we care about.

Example 'rpm -qp spl-0.6.0-rc4.src.rpm --qf %{arch}' output:

Freeing read locks for locker 0x166: 28031/47480843735008
Freeing read locks for locker 0x168: 28031/47480843735008
x86_64

12 years agoUse 0.6.0.18 as the unofficial version.
Darik Horn [Thu, 16 Jun 2011 14:31:35 +0000 (09:31 -0500)]
Use 0.6.0.18 as the unofficial version.

12 years agoUse 0.6.0.17 as the unofficial version.
Darik Horn [Mon, 6 Jun 2011 01:27:43 +0000 (20:27 -0500)]
Use 0.6.0.17 as the unofficial version.

13 years agoUse 0.6.0.16 as the unofficial version.
Darik Horn [Sat, 28 May 2011 20:41:35 +0000 (15:41 -0500)]
Use 0.6.0.16 as the unofficial version.

13 years agoUse 0.6.0.15 as the unofficial version.
Darik Horn [Mon, 23 May 2011 14:10:05 +0000 (09:10 -0500)]
Use 0.6.0.15 as the unofficial version.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Thu, 12 May 2011 01:31:04 +0000 (20:31 -0500)]
Use git-dch to update the debian/changelog.

13 years agoUse 0.6.0.14 as the unofficial version.
Darik Horn [Thu, 12 May 2011 01:30:15 +0000 (20:30 -0500)]
Use 0.6.0.14 as the unofficial version.

13 years agoMerge branch 'upstream'
Darik Horn [Thu, 12 May 2011 01:29:55 +0000 (20:29 -0500)]
Merge branch 'upstream'

13 years agoAdd TASKQ_NORECLAIM flag
Brian Behlendorf [Fri, 6 May 2011 22:21:58 +0000 (15:21 -0700)]
Add TASKQ_NORECLAIM flag

It has become necessary to be able to optionally disable
direct memory reclaim for certain taskqs.  To support
this the TASKQ_NORECLAIM flags has been added which sets
the PF_MEMALLOC bit for all threads in the taskq.

13 years agoUse 0.6.0.13.rc4 as the unofficial version.
Darik Horn [Fri, 6 May 2011 01:35:46 +0000 (20:35 -0500)]
Use 0.6.0.13.rc4 as the unofficial version.

No changes, except that spl-0.6.0-rc4.tar.gz is imported to the git
repository asspl-linux_0.6.0.13.rc4.orig.tar.gz using pristine-tar.

13 years agoUse git-dch to update the debian/changelog.
Darik Horn [Fri, 6 May 2011 00:14:17 +0000 (19:14 -0500)]
Use git-dch to update the debian/changelog.

13 years agoAdd the debhelper token to the spl.postinst script.
Darik Horn [Thu, 5 May 2011 17:31:01 +0000 (12:31 -0500)]
Add the debhelper token to the spl.postinst script.

Resolve this lintian warning:

W: spl-linux source: maintainer-script-lacks-debhelper-token debian/spl.postinst
N:
N:    This package is built using debhelper commands that may modify
N:    maintainer scripts, but the maintainer scripts do not contain the
N:    "#DEBHELPER#" token debhelper uses to modify them.
N:
N:    Adding the token to the scripts is recommended.
N:
N:    Severity: normal, Certainty: possible
N: