]> git.proxmox.com Git - mirror_spl-debian.git/log
mirror_spl-debian.git
6 years agotest test
Fabian Grünbichler [Fri, 28 Jul 2017 09:52:16 +0000 (11:52 +0200)]
test

6 years agotest
Fabian Grünbichler [Fri, 28 Jul 2017 09:52:11 +0000 (11:52 +0200)]
test

6 years agoMerge tag 'spl-0.7.0' into test
Fabian Grünbichler [Fri, 28 Jul 2017 09:51:22 +0000 (11:51 +0200)]
Merge tag 'spl-0.7.0' into test

SPL Version 0.7.0

6 years agoTag spl-0.7.0
Brian Behlendorf [Wed, 26 Jul 2017 17:08:57 +0000 (10:08 -0700)]
Tag spl-0.7.0

META file and changelog updated.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
6 years agoModule parameter to enable spl_panic() to panic the kernel
Oleg Drokin [Wed, 26 Jul 2017 06:03:12 +0000 (02:03 -0400)]
Module parameter to enable spl_panic() to panic the kernel

In unattended operations it's often more useful to have node
panic and reboot when it encounters problems as opposed to
sit there indefinitely waiting for somebody to discover it.

This implements an spl_panic_crash module parameter, set it
to nonzero to cause spl_panic() to call panic().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Closes #634

6 years agoAvoid WARN() from procfs on kstat collision
LOLi [Mon, 24 Jul 2017 17:52:53 +0000 (19:52 +0200)]
Avoid WARN() from procfs on kstat collision

When we load a ZFS pool having spa_name equals to some existing kstat
we would have to create a duplicate entry, which procfs doesn't like.

For instance a ZFS pool named "zil" would have its kstat "txgs"
(module "zfs/zil") intalled under "/proc/spl/kstat/zfs/zil":
unfortunately we already have a kstat named "zil" (module "zfs")
installed in the same procfs location.

Avoid this issue by skipping the duplicate entry creation in procfs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #628

6 years agoLinux 4.13 compat: wait queues
Brian Behlendorf [Mon, 24 Jul 2017 02:32:14 +0000 (19:32 -0700)]
Linux 4.13 compat: wait queues

Commit torvalds/linux@ac6424b9
- Renamed struct wait_queue -> struct wait_queue_entry.

Commit torvalds/linux@2055da97
- Renamed wait_queue_head::task_list -> wait_queue_head::head
- Renamed wait_queue_entry::task_list -> wait_queue_entry::entry

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #629

6 years agoUpdate changelog for new upstream release
Aron Xu [Mon, 17 Jul 2017 06:18:30 +0000 (14:18 +0800)]
Update changelog for new upstream release

6 years agoMerge tag 'upstream/0.6.5.11'
Aron Xu [Fri, 14 Jul 2017 06:39:10 +0000 (14:39 +0800)]
Merge tag 'upstream/0.6.5.11'

Upstream version 0.6.5.11

Conflicts:
META
config/config.guess
config/config.sub
config/install-sh
config/libtool.m4
config/ltmain.sh
configure
rpm/generic/spl-kmod.spec.in
rpm/generic/spl.spec.in
rpm/redhat/spl.spec.in

6 years agoImported Upstream version 0.6.5.11
Aron Xu [Fri, 14 Jul 2017 06:38:33 +0000 (14:38 +0800)]
Imported Upstream version 0.6.5.11

6 years agoTag 0.7.0-rc5
Brian Behlendorf [Thu, 13 Jul 2017 19:07:59 +0000 (12:07 -0700)]
Tag 0.7.0-rc5

Fifth release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
6 years agoDon't cache the system hostid
Brian Behlendorf [Mon, 10 Jul 2017 19:24:52 +0000 (15:24 -0400)]
Don't cache the system hostid

Historically the SPL cached the system hostid the first time it
was accessed.  This was done to speed up subsequent accesses.
But in practice the system host id is rarely accessed and its
inconvenient that it doesn't promptly detect /etc/hostid
configuration changes.  Therefore, zone_get_hostid() has been
updated to always refresh the system hostid reported.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #626

6 years agoAdd ASSERT3B/VERIFY3B/USEC2NSEC/NSEC2USEC macros
Prakash Surya [Mon, 10 Jul 2017 19:44:23 +0000 (12:44 -0700)]
Add ASSERT3B/VERIFY3B/USEC2NSEC/NSEC2USEC macros

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <prakash.surya@delphix.com>
Closes #627

6 years agoUpdate changelog for 0.6.5.10 release
Aron Xu [Wed, 5 Jul 2017 10:54:18 +0000 (18:54 +0800)]
Update changelog for 0.6.5.10 release

6 years agoMerge tag 'upstream/0.6.5.10'
Aron Xu [Wed, 5 Jul 2017 10:00:43 +0000 (18:00 +0800)]
Merge tag 'upstream/0.6.5.10'

Upstream version 0.6.5.10

6 years agoNew upstream version 0.6.5.10
Aron Xu [Wed, 5 Jul 2017 10:00:43 +0000 (18:00 +0800)]
New upstream version 0.6.5.10

6 years agoFix RWSEM_SPINLOCK_IS_RAW check failed
Chunwei Chen [Mon, 19 Jun 2017 18:02:20 +0000 (11:02 -0700)]
Fix RWSEM_SPINLOCK_IS_RAW check failed

Initialize dummy_lock to fix the build error in gcc 7.1.1 with:
  error: ‘dummy_lock’ is used uninitialized in this function

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #622

6 years agoconfig: allow --with-linux without --with-linux-obj
Chunwei Chen [Wed, 24 May 2017 22:42:34 +0000 (15:42 -0700)]
config: allow --with-linux without --with-linux-obj

Don't use `uname -r` to determine kernel build directory when the user
specified kernel source with --with-linux. Otherwise, the user is forced
to use --with-linux-obj even if they are the same directory, which is
very counterintuitive.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
6 years agoImprove gitignore
Chunwei Chen [Wed, 24 May 2017 22:23:37 +0000 (15:23 -0700)]
Improve gitignore

Exclude Makefile.in in module/ and fix the gitignore in cmd/
Also, ignore *.patch and *.orig files

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
6 years agoFix cv_timedwait timeout
Brian Behlendorf [Thu, 25 May 2017 17:01:44 +0000 (10:01 -0700)]
Fix cv_timedwait timeout

Perform the already past expiration time check before updating
cvp->cv_mutex with the provided mutex.  This check only depends
on local state.  Doing it first ensures that cvp->cv_mutex will not
be updated in the timeout case or if it's ever called with an
expire_time <= now.

Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #616

6 years agoLinux 4.12 compat: PF_FSTRANS was removed
Chunwei Chen [Tue, 9 May 2017 17:36:54 +0000 (10:36 -0700)]
Linux 4.12 compat: PF_FSTRANS was removed

Change SPL_FSTRANS to optionally contains PF_FSTRANS. Also, add
__spl_pf_fstrans_check for the checks specifically for PF_FSTRANS.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #614

6 years agoTag 0.7.0-rc4
Brian Behlendorf [Fri, 5 May 2017 16:23:03 +0000 (09:23 -0700)]
Tag 0.7.0-rc4

Fourth release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoglibc 2.25 compat: remove assert(X=Y)
Olaf Faaland [Mon, 3 Apr 2017 20:33:49 +0000 (13:33 -0700)]
glibc 2.25 compat: remove assert(X=Y)

The assert() related definitions in glibc 2.25 were altered to warn
about assert(X=Y) when -Wparentheses is used.  See
https://abi-laboratory.pro/tracker/changelog/glibc/2.25/log.html

lib/list.c used this construct to set the value of a magic field which
is defined only when debugging.

Replaced the assert()s with #ifndef/#endifs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #610

7 years agoLinux 4.11 compat: remove stub for __put_task_struct
Olaf Faaland [Mon, 13 Mar 2017 17:37:10 +0000 (10:37 -0700)]
Linux 4.11 compat: remove stub for __put_task_struct

Before kernel 2.6.29 credentials were embedded in task_structs, and zfs had
cases where one thread would need to refer to the credential of another thread,
forcing it to take a hold on the foreign thread's task_struct to ensure it was
not freed.

Since 2.6.29, the credential has been moved out of the task_struct into a
cred_t.

In addition, the mainline kernel originally did not export __put_task_struct()
but the RHEL5 kernel did, according to zfsonlinux/spl@e811949a570.  As of
2.6.39 the mainline kernel exports it.

There is no longer zfs code that takes or releases holds on a task_struct, and
so there is no longer any reference to __put_task_struct().

This affects the linux 4.11 kernel because the prototype for
__put_task_struct() is in a new include file (linux/sched/task.h) and so the
config check failed to detect the exported symbol.

Removing the unnecessary stub and corresponding config check.  This works on
kernels since the oldest one currently supported, 2.6.32 as shipped with
Centos/RHEL.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #608

7 years agoLinux 4.11 compat: add linux/sched/signal.h
Olaf Faaland [Tue, 7 Mar 2017 23:33:50 +0000 (15:33 -0800)]
Linux 4.11 compat: add linux/sched/signal.h

In Linux 4.11, torvalds/linux@2a1f062, signal handling related functions
were moved from sched.h into sched/signal.h.

Add configure checks to detect this and include the new file where
needed.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #608

7 years agoLinux 4.11 compat: vfs_getattr() takes 4 args
Olaf Faaland [Tue, 7 Mar 2017 21:18:53 +0000 (13:18 -0800)]
Linux 4.11 compat: vfs_getattr() takes 4 args

There are changes to vfs_getattr() in torvalds/linux@a528d35.  The new
interface is:

int vfs_getattr(const struct path *path, struct kstat *stat,
               u32 request_mask, unsigned int query_flags)

The request_mask argument indicates which field(s) the caller intends to
use.  Fields the caller does not specify via request_mask may be set in
the returned struct anyway, but their values may be approximate.

The query_flags argument indicates whether the filesystem must update
the attributes from the backing store.

This patch uses the query_flags which result in vfs_getattr behaving the same
as it did with the 2-argument version which the kernel provided before
Linux 4.11.

Members blksize and blocks are now always the same size regardless of
arch.  They match the size of the equivalent members in vnode_t.

The configure checks are modified to ensure that the appropriate
vfs_getattr() interface is used.

A more complete fix, removing the ZFS dependency on vfs_getattr()
entirely, is deferred as it is a much larger project.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #608

7 years agoFix powerpc build
Brian Behlendorf [Mon, 6 Mar 2017 17:16:22 +0000 (09:16 -0800)]
Fix powerpc build

Unlike other architectures which sanitize the LDFLAGS from the
environment in arch/<arch>/Makefile.  The powerpc Makefile
allows LDFLAGS to be passed through resulting in the following
build failure.

  /usr/bin/ld: unrecognized option '-Wl,-z,relro'

LDFLAGS is set in /usr/lib/rpm/redhat/macros by default.  Clear
the environment variable when building kmods for powerpc.

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #607

7 years agoLinux 4.11 compat: set_task_state() removed
Olaf Faaland [Thu, 23 Feb 2017 17:52:08 +0000 (09:52 -0800)]
Linux 4.11 compat: set_task_state() removed

Replace uses of set_task_state(current, STATE) with
set_current_state(STATE).

In Linux 4.11, torvalds/linux@642fa44, set_task_state() is removed.

All spl uses are of the form set_task_state(current, STATE).
set_current_state(STATE) is equivalent and has been available since
Linux 2.2.26.

Furthermore, set_current_state(STATE) is already used in about 15
locations within spl.  This change should have no impact other than
removing an unnecessary dependency.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #603

7 years agoRelease 0.6.5.9-1
Aron Xu [Mon, 6 Feb 2017 07:54:13 +0000 (15:54 +0800)]
Release 0.6.5.9-1

7 years agoRemove patches not needed anymore
Aron Xu [Mon, 6 Feb 2017 07:53:42 +0000 (15:53 +0800)]
Remove patches not needed anymore

7 years agoImported Upstream version 0.6.5.9
Aron Xu [Mon, 6 Feb 2017 07:49:57 +0000 (15:49 +0800)]
Imported Upstream version 0.6.5.9

7 years agoMerge tag 'upstream/0.6.5.9'
Aron Xu [Mon, 6 Feb 2017 07:49:57 +0000 (15:49 +0800)]
Merge tag 'upstream/0.6.5.9'

Upstream version 0.6.5.9

7 years agoUse kernel slab for vn_cache and vn_file_cache
Chunwei Chen [Tue, 31 Jan 2017 21:44:01 +0000 (13:44 -0800)]
Use kernel slab for vn_cache and vn_file_cache

Resolve a false positive in the kmemleak checker by shifting to the
kernel slab.  It shows up because vn_file_cache is using KMC_KMEM
which is directly allocated using __get_free_pages, which is not
automatically tracked by kmemleak.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #599

7 years agoAdd a PAGESHIFT definition
David Quigley [Tue, 31 Jan 2017 18:36:18 +0000 (11:36 -0700)]
Add a PAGESHIFT definition

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: David Quigley <david.quigley@intel.com>
Closes #598

7 years agoTag 0.7.0-rc3
Brian Behlendorf [Fri, 20 Jan 2017 18:16:32 +0000 (10:16 -0800)]
Tag 0.7.0-rc3

Third release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoReimplement rt_mutex_owner to fix build with DEBUG & PREEMPT_RT_FULL
clefru [Thu, 19 Jan 2017 22:41:38 +0000 (23:41 +0100)]
Reimplement rt_mutex_owner to fix build with DEBUG & PREEMPT_RT_FULL

rt_mutex_owner is internal to kernel/locking/rtmutex_common.h and
inaccessible for SPL via the public kernel headers. The way of
accessing the owner has been stable since at least 3.13 ([1], [2]),
which is masking the lowest bit in the owner pointer in rt_mutex. We
do the same.

[1] http://lxr.free-electrons.com/source/kernel/locking/rtmutex_common.h?v=3.13#L99
[2] http://lxr.free-electrons.com/source/kernel/locking/rtmutex_common.h?v=4.9#L78

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Clemens Fruhwirth <clemens@endorphin.org>
Closes #593

7 years agoRemove identical if statements in module/spl/spl-vnode.c
George Melikov [Thu, 19 Jan 2017 22:32:45 +0000 (01:32 +0300)]
Remove identical if statements in module/spl/spl-vnode.c

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Melikov <mail@gmelikov.ru>
Closes #594

7 years agoAdd support for recent kmem_cache_create_usercopy
Kevin Tanguy [Tue, 17 Jan 2017 20:05:14 +0000 (21:05 +0100)]
Add support for recent kmem_cache_create_usercopy

SLAB_USERCOPY flag was used to indicate PAX
not to kill copies from kernel to userland.

With recent grsecurity patchset and
CONFIG_GRKERNSEC_HIDESYM that enables
CONFIG_PAX_USERCOPY zfs would panic.

Handle newer API while keeping old one functional.

Tested-by: RageLtMan <rageltman@sempervictus>
Reviewed-by: spendergrsec <spender@grsecurity.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kevin Tanguy <kevin.tanguy@ovh.net>
Closes #595

7 years agoFix Linux 4.9 compatibility (Closes: #851352)
Aron Xu [Tue, 17 Jan 2017 14:43:41 +0000 (22:43 +0800)]
Fix Linux 4.9 compatibility (Closes: #851352)

7 years agoUpdate struct member intializers to C89
RageLtMan [Fri, 13 Jan 2017 22:12:42 +0000 (17:12 -0500)]
Update struct member intializers to C89

When building SPL within the kernel tree, C99 initializers cause
build failures and need to be converted to C89 as kernel CFLAGS
specify -std=gnu89.

This fix was provided by @behlendorf in #595 discussion notes and
manually implemented in the current master revision.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: RageLtMan <rageltman@sempervictus>
Closes #597

7 years agoAdd support for rw semaphore under PREEMPT_RT_FULL
Clemens Fruhwirth [Sat, 17 Dec 2016 16:09:57 +0000 (17:09 +0100)]
Add support for rw semaphore under PREEMPT_RT_FULL

The main complication from the RT patch set is that the RW semaphore
locks change such that read locks on an rwsem can be taken only by
a single thread.  All other threads are locked out. This single
thread can take a read lock multiple times though. The underlying
implementation changes to a mutex with an additional read_depth
count.

The implementation can be best understood by inspecting the RT
patch.  rwsem_rt.h and rt.c give the best insight into how RT
rwsem works. My implementation for rwsem_tryupgrade is basically
an inversion of rt_downgrade_write found in rt.c. Please see the
comments in the code.

Unfortunately, I have to drop SPLAT rwlock test4 completely as this
test tries to take multiple locks from different threads, which RT
rwsems do not support.  Otherwise SPLAT, zconfig.sh, zpios-sanity.sh
and zfs-tests.sh pass on my Debian-testing VM with the kernel
linux-image-4.8.0-1-rt-amd64.

Tested-by: kernelOfTruth <kerneloftruth@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Clemens Fruhwirth <clemens@endorphin.org>
Closes zfsonlinux/zfs#5491
Closes #589
Closes #308

7 years agoRemove stale comment from rw_tryupgrade()
Clemens Fruhwirth [Sat, 17 Dec 2016 16:10:25 +0000 (17:10 +0100)]
Remove stale comment from rw_tryupgrade()

Commit f58040c0fc8bc6490fcc75db7fc3e709dfc3c656 should have removed
this comment which is no longer relevant.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Clemens Fruhwirth <clemens@endorphin.org>
Issue #589

7 years agoRefactor some splat macro to function
Chunwei Chen [Thu, 15 Dec 2016 02:24:47 +0000 (18:24 -0800)]
Refactor some splat macro to function

Refactor the code by making splat_test_{init,fini}, splat_subsystem_{init,fini}
into functions. They don't have reason to be macro and it would be too bloated
to inline every call.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
7 years agoFix splat memleak
Chunwei Chen [Thu, 15 Dec 2016 19:12:50 +0000 (11:12 -0800)]
Fix splat memleak

SPLAT_TEST_FINI didn't call kfree causing memleak.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
7 years agoAdd system_delay_taskq for long delay
Chunwei Chen [Thu, 8 Dec 2016 21:00:20 +0000 (13:00 -0800)]
Add system_delay_taskq for long delay

Add a dedicated system_delay_taskq for long delay like spa_deadman and
zpl_posix_acl_free. This will allow us to use system_taskq in the manner of
dispatch multiple tasks and call taskq_wait_outstanding.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #588

7 years agoLimit number of tasks shown in taskq proc
Chunwei Chen [Thu, 1 Dec 2016 18:06:27 +0000 (10:06 -0800)]
Limit number of tasks shown in taskq proc

To prevent holding tq_lock for too long.

Before zfsonlinux/zfs@8e71ab9, hogging delay tasks and cat /proc/spl/taskq
would easily cause a lockup. While that bug has been fixed. It's probably
still a good idea to do this just in case task lists grow too large.

Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #586

7 years agoAdd TASKQID_INVALID and TASKQID_INITIAL macros
Ubuntu [Fri, 28 Oct 2016 21:23:30 +0000 (21:23 +0000)]
Add TASKQID_INVALID and TASKQID_INITIAL macros

Add the TASKQID_INVALID and TASKQID_INITIAL macros and update the
taskq implementation and test cases to use them.  This is solely
for the purposes of readability and introduces no functional change.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoFix vmem_size()
Ubuntu [Fri, 28 Oct 2016 20:56:38 +0000 (20:56 +0000)]
Fix vmem_size()

Add a minimal implementation of vmem_size() which accounts for the
virtual memory usage of the SPL's kmem cache.  This functionality
is only useful on 32-bit systems with a small virtual address space.

The following assumptions are made:

  1) The major SPL consumer of virtual memory is the kmem cache.
  2) Memory allocated with vmem_alloc() is short lived and can be ignored.
  3) Allow a 4MB floor as a generous pad given normal consumption.
  4) The spl_kmem_cache_sem only contends with cache create/destroy.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoTag 0.7.0-rc2
Brian Behlendorf [Tue, 25 Oct 2016 20:13:49 +0000 (13:13 -0700)]
Tag 0.7.0-rc2

Second release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoRasie dkms version to >> 2.2.1.0
Aron Xu [Fri, 21 Oct 2016 06:18:07 +0000 (14:18 +0800)]
Rasie dkms version to >> 2.2.1.0

This would let users get a newer version of dkms, but at least till
this point using an older version of dkms is still working.

7 years agoRestore the compatibility to dkms < 2.2.0.3-3 (Closes: #838706)
Al Nikolov [Fri, 21 Oct 2016 05:55:06 +0000 (13:55 +0800)]
Restore the compatibility to dkms < 2.2.0.3-3 (Closes: #838706)

7 years agoLinux 4.9 compat: group_info changes
Chunwei Chen [Wed, 19 Oct 2016 00:30:41 +0000 (17:30 -0700)]
Linux 4.9 compat: group_info changes

In Linux 4.9, torvalds/linux@81243ea, group_info changed from 2d array via
->blocks to 1d array via ->gid. We change the spl cred functions accordingly.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #581

7 years agoFix splat-cred.c cred usage
Chunwei Chen [Wed, 19 Oct 2016 00:29:26 +0000 (17:29 -0700)]
Fix splat-cred.c cred usage

No need to crhold current_cred(), fix possible leak in splat_cred_test2

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #556

7 years agoFix crgetgroups out-of-bound and misc cred fix
Chunwei Chen [Tue, 18 Oct 2016 22:52:30 +0000 (15:52 -0700)]
Fix crgetgroups out-of-bound and misc cred fix

init_groups has 0 nblocks, therefore calling the current crgetgroups with
init_groups would result in out-of-bound access. We fix this by returning NULL
when nblocks is 0.

Cap crgetngroups to NGROUPS_PER_BLOCK, since crgetgroups will only return
blocks[0].

Also, remove all get_group_info. The cred already holds reference on the
group_info, and cred is not mutable. So there's no reason to hold extra
reference, if we hold cred.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #556

7 years agoFix out-of-bound in per_cpu in spl_random_init
tuxoko [Sat, 8 Oct 2016 03:59:46 +0000 (20:59 -0700)]
Fix out-of-bound in per_cpu in spl_random_init

When iterating per_cpu values, we need to use for_each_possible_cpu. While
NR_CPUS indicates the number of CPU supported by the kernel, it might not
initialize all of them if the kernel decides it's not possible to use them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #578

7 years agoLinux 4.8 compat: Fix RW_READ_HELD
tuxoko [Sat, 8 Oct 2016 03:53:58 +0000 (20:53 -0700)]
Linux 4.8 compat: Fix RW_READ_HELD

Linux 4.8, starting from torvalds/linux@19c5d690e, will set owner to 1 when
read held instead of leave it NULL. So we change the condition to
`rw_owner(rwp) <= 1` in RW_READ_HELD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes zfsonlinux/zfs#5233
Closes #577

7 years agoFix p0 initializer
Brian Behlendorf [Wed, 5 Oct 2016 00:26:36 +0000 (17:26 -0700)]
Fix p0 initializer

Due to changes in the task_struct the following warning is occurs
when initializing the global p0.  Since this structure only exists
for it's address to be taken initialize it in a manor which isn't
sensitive to internal changes to the structure.

  module/spl/spl-generic.c:58:1: error: missing braces around
  initializer [-Werror=missing-braces]

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

7 years agoFix aarch64 type warning
Brian Behlendorf [Sun, 2 Oct 2016 01:33:01 +0000 (18:33 -0700)]
Fix aarch64 type warning

Explicitly cast type in splat-rwlock.c test case to silence
the following warning.

  warning: format ‘%ld’ expects argument of type ‘long int’,
  but argument N has type ‘int’

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

7 years agoRelease new version to unstable
Aron Xu [Tue, 27 Sep 2016 21:11:07 +0000 (05:11 +0800)]
Release new version to unstable

7 years agoMove command-with-path-in-maintainer-script override to spl
Aron Xu [Tue, 27 Sep 2016 21:09:11 +0000 (05:09 +0800)]
Move command-with-path-in-maintainer-script override to spl

7 years agoInstall man pages for spl
Aron Xu [Tue, 27 Sep 2016 20:55:55 +0000 (04:55 +0800)]
Install man pages for spl

7 years agoHandle the case /etc/hostid is being wrongly marked as conffile
Aron Xu [Tue, 27 Sep 2016 18:47:26 +0000 (02:47 +0800)]
Handle the case /etc/hostid is being wrongly marked as conffile

There are packages distributed with /etc/hostid file installed as conffile,
which is going to cause problem when the package is purged. Here we detect
such case and migrate it to an ordinary file that preserves during purge.

Also replace the endianness detection code to use od(1) from coreutils
instead of requiring gcc

7 years agoSimplify rules by merging Ubuntu one
Aron Xu [Tue, 27 Sep 2016 18:12:25 +0000 (02:12 +0800)]
Simplify rules by merging Ubuntu one

7 years agoAdd lintian-overrides: extra-license-file
Aron Xu [Tue, 27 Sep 2016 18:12:10 +0000 (02:12 +0800)]
Add lintian-overrides: extra-license-file

7 years agoDeal with /etc/hostid in postinst of spl package
Aron Xu [Tue, 27 Sep 2016 17:52:29 +0000 (01:52 +0800)]
Deal with /etc/hostid in postinst of spl package

7 years agoMake use of dh-autoreconf
Aron Xu [Tue, 27 Sep 2016 17:33:19 +0000 (01:33 +0800)]
Make use of dh-autoreconf

7 years agoFix automatically generated release number
Brian Behlendorf [Wed, 21 Sep 2016 20:44:32 +0000 (13:44 -0700)]
Fix automatically generated release number

When building from the head of a branch a release number is
automatically generated with `git describe` using the last tag
on that branch as the base.  For this to work the last tag on the
branch needs to be predictable given the current META file.

This logic was accidentally broken when an -rcX tag was added to
the branch.  Update it to search for a VERSION or VERSION-RELEASE
tag.

Reviewed-by: Chris Siebenmann <cks.git01@cs.toronto.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#5105
Closes #572

7 years agoAdded extra autopkgtest script check.sh from the Ubuntu package.
Petter Reinholdtsen [Sun, 18 Sep 2016 06:55:30 +0000 (08:55 +0200)]
Added extra autopkgtest script check.sh from the Ubuntu package.

7 years agoAdded d/gbp.conf to enforce the use of pristine-tar.
Petter Reinholdtsen [Sun, 18 Sep 2016 06:35:51 +0000 (08:35 +0200)]
Added d/gbp.conf to enforce the use of pristine-tar.

7 years agoUpdate changelog
Aron Xu [Sat, 17 Sep 2016 17:26:29 +0000 (01:26 +0800)]
Update changelog

7 years agoAllow parallel building
Aron Xu [Sat, 17 Sep 2016 17:19:45 +0000 (01:19 +0800)]
Allow parallel building

7 years agocontrol: bump standards version to 3.9.8
Zhou Mo [Sat, 17 Sep 2016 17:14:27 +0000 (01:14 +0800)]
control: bump standards version to 3.9.8

7 years agoFix invalid command in dkms, thanks Petter Reinholdtsen. (Closes #836578)
Zhou Mo [Sat, 17 Sep 2016 16:47:38 +0000 (16:47 +0000)]
Fix invalid command in dkms, thanks Petter Reinholdtsen. (Closes #836578)

7 years agoMerge tag 'upstream/0.6.5.8'
Aron Xu [Sat, 17 Sep 2016 16:59:03 +0000 (00:59 +0800)]
Merge tag 'upstream/0.6.5.8'

Upstream version 0.6.5.8

7 years agoImported Upstream version 0.6.5.8
Aron Xu [Sat, 17 Sep 2016 16:59:02 +0000 (00:59 +0800)]
Imported Upstream version 0.6.5.8

7 years agoIncrease spl_kmem_alloc_warn limit
Brian Behlendorf [Sat, 17 Sep 2016 00:10:36 +0000 (17:10 -0700)]
Increase spl_kmem_alloc_warn limit

In order to support ABD with large blocks the spl_kmem_alloc_warn
limit needs to be increased to 64K.

A 16M block requires that pointers be stored for 4096 4K-pages
on an x86_64 system.  Each of these pointers is 8 bytes requiring
an allocation of 8*4096=32,768 bytes.  The addition of a small
header to this structure pushes the allocation over the default
32K warning threshold.

In addition, fix a small bug where MAX was used instead of MIN
when setting the default.  This ensures a reasonable limit is
still set on systems with page sizes larger then 4K.

Reviewed-by: David Quigley <david.quigley@intel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #571

7 years agoFix spl check.sh script
legend-hua [Thu, 15 Sep 2016 00:17:00 +0000 (08:17 +0800)]
Fix spl check.sh script

Update splat_cmd to reference the correct location of the splat utility.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Liu Hua<liu.hua130@zte.com.cn>
Closes #570

7 years agoCleanup in cred.h
tuxoko [Wed, 14 Sep 2016 23:59:31 +0000 (16:59 -0700)]
Cleanup in cred.h

Remove the code that doesn't make any sense.

Reviewed-by: Brian Behlendorf <behlendorf@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #569

7 years agoTag 0.7.0-rc1
Brian Behlendorf [Wed, 7 Sep 2016 17:33:21 +0000 (10:33 -0700)]
Tag 0.7.0-rc1

First release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
7 years agoChanged Standards-Version from 3.9.6 to 3.9.8.
Petter Reinholdtsen [Mon, 22 Aug 2016 12:57:04 +0000 (12:57 +0000)]
Changed Standards-Version from 3.9.6 to 3.9.8.

7 years agoFix: handle NULL case in spl_kmem_free_track()
GeLiXin [Fri, 19 Aug 2016 06:50:21 +0000 (14:50 +0800)]
Fix: handle NULL case in spl_kmem_free_track()

When DEBUG_KMEM_TRACKING is enabled in SPL, we keep tracking all
the buffers alloced by kmem_alloc() and kmem_zalloc().  If a NULL
pointer which indicates no track info in SPL is passed to
spl_kmem_free_track, we just ignore it.

Signed-off-by: GeLiXin <ge.lixin@zte.com.cn>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#4967
Closes #567

7 years agoFix HAVE_MUTEX_OWNER test for kernels prior to 4.6
Tim Chase [Mon, 1 Aug 2016 13:19:19 +0000 (08:19 -0500)]
Fix HAVE_MUTEX_OWNER test for kernels prior to 4.6

Recent 4.X kernels prior to 4.6 require #include of spinlock.h in
order to get the definition of __ARCH_SPIN_LOCK_UNLOCKED which is
used by DEFINE_MUTEX().

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #566

7 years agoAdd handling for kernel 4.7's CONFIG_TRIM_UNUSED_KSYMS
Nikolay Borisov [Fri, 29 Jul 2016 15:48:33 +0000 (18:48 +0300)]
Add handling for kernel 4.7's CONFIG_TRIM_UNUSED_KSYMS

Kernel 4.7 added the option to trim the unused exported symbols. In
my testing this showed to be problematic since the PDE_DATA function
was considered unused and as such was trimmed. This in turn caused the
respective test during spl's configure stage to falsely detect that
PDE_DATA is not defined, which in turn caused build failures later.

Handle this situation by adding detection whether CONFIG_TRIM_UNUSED_KSYMS
is enabled and refuse to build against a kernel which has it enabled

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #565

7 years agoAdd gitignore entry for spl-*.o.d files
Nikolay Borisov [Fri, 29 Jul 2016 15:48:04 +0000 (18:48 +0300)]
Add gitignore entry for spl-*.o.d files

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #565

7 years agoLinux 4.8 compat: rw_semaphore atomic_long_t count
Brian Behlendorf [Tue, 26 Jul 2016 23:37:46 +0000 (23:37 +0000)]
Linux 4.8 compat: rw_semaphore atomic_long_t count

For non-rwsem-spinlocks the "count" member was changed from a
"long" to "atomic_long_t" type.  A configure check has been
added to detect this change along with new versions of the
_rwsem_tryupgrade() function and RWSEM_COUNT() macro.  See
https://github.com/torvalds/linux/commit/8ee62b18 for complete
details.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #563

7 years agoAdded highbit() and lowbit() macros
Tom Caputi [Thu, 14 Jul 2016 19:51:24 +0000 (15:51 -0400)]
Added highbit() and lowbit() macros

Signed-off-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #562

7 years agoAdd _ALIGNMENT_REQUIRED to isa_defs.h for checksums
Tony Hutter [Wed, 15 Jun 2016 00:36:39 +0000 (17:36 -0700)]
Add _ALIGNMENT_REQUIRED to isa_defs.h for checksums

_ALIGNMENT_REQUIRED needs to be #defined in isa_defs.h in order to
port the Illumos checksum code to ZoL:

4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R
OpenZFS-issue: https://www.illumos.org/issues/4185
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/45818ee

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #561

7 years agoImprove spl slab cache alloc
Jinshan Xiong [Thu, 19 May 2016 17:59:40 +0000 (10:59 -0700)]
Improve spl slab cache alloc

The policy is to try to allocate with KM_NOSLEEP, which will lead to
memory allocation with GFP_ATOMIC, and if it fails, it will launch
an taskq to expand slab space.

This way it should be able to get better NUMA memory locality and
reduce the overhead of context switch.

Signed-off-by: Jinshan Xiong <jinshan.xiong@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #551

7 years agoFix use-after-free in splat_taskq_test7
Chunwei Chen [Sat, 28 May 2016 00:28:12 +0000 (17:28 -0700)]
Fix use-after-free in splat_taskq_test7

This splat_vprint is using tq_arg->name after tq_arg is freed.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #557

7 years agoImplement a proper rw_tryupgrade
Chunwei Chen [Wed, 25 May 2016 23:35:42 +0000 (16:35 -0700)]
Implement a proper rw_tryupgrade

Current rw_tryupgrade does rw_exit and then rw_tryenter(RW_RWITER), and then
does rw_enter(RW_READER) if it fails. This violate the assumption that
rw_tryupgrade should be atomic and could cause extra contention or even lock
inversion.

This patch we implement a proper rw_tryupgrade. For rwsem-spinlock, we take
the spinlock to check rwsem->count and rwsem->wait_list. For normal rwsem, we
use cmpxchg on rwsem->count to change the value from single reader to single
writer.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes zfsonlinux/zfs#4692
Closes #554

7 years agoAdd isa_defs for MIPS
YunQiang Su [Sat, 28 May 2016 11:30:36 +0000 (19:30 +0800)]
Add isa_defs for MIPS

GCC for MIPS only defines _LP64 when 64bit,
while no _ILP32 defined when 32bit.

Signed-off-by: YunQiang Su <syq@debian.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #558

7 years agoDebian revision 0.6.5.7-1
Aron Xu [Wed, 25 May 2016 04:20:16 +0000 (12:20 +0800)]
Debian revision 0.6.5.7-1

7 years agoMerge tag 'upstream/0.6.5.7'
Aron Xu [Wed, 25 May 2016 04:15:20 +0000 (12:15 +0800)]
Merge tag 'upstream/0.6.5.7'

Upstream version 0.6.5.7

7 years agoImported Upstream version 0.6.5.7
Aron Xu [Wed, 25 May 2016 04:15:19 +0000 (12:15 +0800)]
Imported Upstream version 0.6.5.7

7 years agoFix taskq_wait_outstanding re-evaluate tq_next_id
Chunwei Chen [Mon, 23 May 2016 21:12:22 +0000 (14:12 -0700)]
Fix taskq_wait_outstanding re-evaluate tq_next_id

wait_event is a macro, so the current implementation will cause re-
evaluation of tq_next_id every time it wakes up. This would cause
taskq_wait_outstanding(tq, 0) to be equivalent to taskq_wait(tq)

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #553

7 years agoFix race between taskq_destroy and dynamic spawning thread
Chunwei Chen [Sat, 21 May 2016 01:04:03 +0000 (18:04 -0700)]
Fix race between taskq_destroy and dynamic spawning thread

While taskq_destroy would wait for dynamic_taskq to finish its tasks, but it
does not implies the thread being spawned is up and running. This will cause
taskq to be freed before the thread can exit.

We fix this by using tq_nspawn to indicate how many threads are being spawned
before they are inserted to the thread list. And have taskq_destroy to wait
for it to drop to zero.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #553
Closes #550

7 years agoRestore CALLOUT_FLAG_ABSOLUTE in cv_timedwait_hires
Chunwei Chen [Fri, 20 May 2016 23:35:52 +0000 (16:35 -0700)]
Restore CALLOUT_FLAG_ABSOLUTE in cv_timedwait_hires

In 39cd90e, I mistakenly disabled the ability of using absolute expire time in
cv_timedwait_hires. I don't quite sure why I did that, so let's restore it.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #553

7 years agoLinux 4.7 compat: inode_lock() and friends
Chunwei Chen [Wed, 18 May 2016 18:28:46 +0000 (11:28 -0700)]
Linux 4.7 compat: inode_lock() and friends

Linux 4.7 changes i_mutex to i_rwsem, and we should used inode_lock and
inode_lock_shared to do exclusive and shared lock respectively.

We use spl_inode_lock{,_shared}() to hide the difference. Note that on older
kernel you'll always take an exclusive lock.

We also add all other inode_lock friends. And nested users now should
explicitly call spl_inode_lock_nested with correct subclass.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#4665
Closes #549

7 years agoAdd cv_timedwait_sig_hires to allow interruptible sleep
Chunwei Chen [Wed, 11 May 2016 23:51:29 +0000 (16:51 -0700)]
Add cv_timedwait_sig_hires to allow interruptible sleep

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #548

7 years agoAdd a macro to convert seconds to nanoseconds and vice-versa
David Quigley [Thu, 5 May 2016 23:10:46 +0000 (19:10 -0400)]
Add a macro to convert seconds to nanoseconds and vice-versa

Required infrastructure for zfsonlinux/zfs#4600.

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