]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
New upstream version 0.7.4
authorAron Xu <aron@debian.org>
Mon, 18 Dec 2017 14:04:40 +0000 (22:04 +0800)
committerAron Xu <aron@debian.org>
Mon, 18 Dec 2017 14:04:40 +0000 (22:04 +0800)
13 files changed:
META
config/spl-build.m4
configure
include/linux/file_compat.h
man/man1/splat.1
man/man5/spl-module-parameters.5
module/spl/spl-kstat.c
module/spl/spl-taskq.c
module/spl/spl-vnode.c
rpm/generic/spl-kmod.spec.in
rpm/generic/spl.spec.in
rpm/redhat/spl.spec.in
spl_config.h.in

diff --git a/META b/META
index 4aae365bc714e6bc8cbcbda343a3066b49a7825a..a55e57fa271814f2bf77bbe32d66a92fc78c0df2 100644 (file)
--- a/META
+++ b/META
@@ -1,7 +1,7 @@
 Meta:         1
 Name:         spl
 Branch:       1.0
-Version:      0.7.3
+Version:      0.7.4
 Release:      1
 Release-Tags: relext
 License:      GPL
index b2a50bf164b9908235587c6e00e786c5dc06583d..accf6759bfbe54b31135702f8f16c2a3b8702bd1 100644 (file)
@@ -54,6 +54,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_KMEM_CACHE_CREATE_USERCOPY
        SPL_AC_WAIT_QUEUE_ENTRY_T
        SPL_AC_WAIT_QUEUE_HEAD_ENTRY
+       SPL_AC_KERNEL_WRITE
+       SPL_AC_KERNEL_READ
 ])
 
 AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -1695,3 +1697,61 @@ AC_DEFUN([SPL_AC_WAIT_QUEUE_HEAD_ENTRY], [
                AC_MSG_RESULT(no)
        ])
 ])
+
+dnl #
+dnl # 4.14 API change
+dnl # kernel_write() which was introduced in 3.9 was updated to take
+dnl # the offset as a pointer which is needed by vn_rdwr().
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_WRITE], [
+       AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       SPL_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               struct file *file = NULL;
+               const void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_write(file, buf, count, pos);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
+                   [kernel_write() take loff_t pointer])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
+dnl # 4.14 API change
+dnl # kernel_read() which has existed for forever was updated to take
+dnl # the offset as a pointer which is needed by vn_rdwr().
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_READ], [
+       AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       SPL_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               struct file *file = NULL;
+               void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_read(file, buf, count, pos);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
+                   [kernel_read() take loff_t pointer])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+])
index fabccd0c93381a0bb1f7c2bf23231a4760cf87d6..9f80bafb6ef3a4767db686188f228ecf2719ef6f 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for spl 0.7.3.
+# Generated by GNU Autoconf 2.63 for spl 0.7.4.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='spl'
 PACKAGE_TARNAME='spl'
-PACKAGE_VERSION='0.7.3'
-PACKAGE_STRING='spl 0.7.3'
+PACKAGE_VERSION='0.7.4'
+PACKAGE_STRING='spl 0.7.4'
 PACKAGE_BUGREPORT=''
 
 # Factoring default headers for most tests.
@@ -1535,7 +1535,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures spl 0.7.3 to adapt to many kinds of systems.
+\`configure' configures spl 0.7.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1606,7 +1606,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of spl 0.7.3:";;
+     short | recursive ) echo "Configuration of spl 0.7.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1720,7 +1720,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-spl configure 0.7.3
+spl configure 0.7.4
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1734,7 +1734,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by spl $as_me 0.7.3, which was
+It was created by spl $as_me 0.7.4, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2888,7 +2888,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='spl'
- VERSION='0.7.3'
+ VERSION='0.7.4'
 
 
 cat >>confdefs.h <<_ACEOF
 
 
 
+
+       { $as_echo "$as_me:$LINENO: checking whether kernel_write() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_write() takes loff_t pointer... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *file = NULL;
+               const void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_write(file, buf, count, pos);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_WRITE_PPOS 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:$LINENO: checking whether kernel_read() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_read() takes loff_t pointer... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *file = NULL;
+               void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_read(file, buf, count, pos);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_READ_PPOS 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
  ;;
                user)      ;;
                all)
 
 
 
+       { $as_echo "$as_me:$LINENO: checking whether kernel_write() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_write() takes loff_t pointer... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *file = NULL;
+               const void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_write(file, buf, count, pos);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_WRITE_PPOS 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:$LINENO: checking whether kernel_read() takes loff_t pointer" >&5
+$as_echo_n "checking whether kernel_read() takes loff_t pointer... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *file = NULL;
+               void *buf = NULL;
+               size_t count = 0;
+               loff_t *pos = NULL;
+               ssize_t ret;
+
+               ret = kernel_read(file, buf, count, pos);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_READ_PPOS 1
+_ACEOF
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
                           ;;
                srpm)                        ;;
                *)
@@ -19350,7 +19654,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by spl $as_me 0.7.3, which was
+This file was extended by spl $as_me 0.7.4, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19413,7 +19717,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-spl config.status 0.7.3
+spl config.status 0.7.4
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index 916514566a23807fcd83ca4431f48ab72151259a..2fd6e5fc8779035b601f218210e4d567398c344d 100644 (file)
@@ -26,6 +26,7 @@
 #define _SPL_FILE_COMPAT_H
 
 #include <linux/fs.h>
+#include <linux/uaccess.h>
 #ifdef HAVE_FDTABLE_HEADER
 #include <linux/fdtable.h>
 #endif
@@ -70,6 +71,46 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
        return (error);
 }
 
+static inline ssize_t
+spl_kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
+{
+#if defined(HAVE_KERNEL_WRITE_PPOS)
+       return (kernel_write(file, buf, count, pos));
+#else
+       mm_segment_t saved_fs;
+       ssize_t ret;
+
+       saved_fs = get_fs();
+       set_fs(get_ds());
+
+       ret = vfs_write(file, (__force const char __user *)buf, count, pos);
+
+       set_fs(saved_fs);
+
+       return (ret);
+#endif
+}
+
+static inline ssize_t
+spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
+{
+#if defined(HAVE_KERNEL_READ_PPOS)
+       return (kernel_read(file, buf, count, pos));
+#else
+       mm_segment_t saved_fs;
+       ssize_t ret;
+
+       saved_fs = get_fs();
+       set_fs(get_ds());
+
+       ret = vfs_read(file, (void __user *)buf, count, pos);
+
+       set_fs(saved_fs);
+
+       return (ret);
+#endif
+}
+
 #ifdef HAVE_2ARGS_VFS_FSYNC
 #define        spl_filp_fsync(fp, sync)        vfs_fsync(fp, sync)
 #else
index 37f8435b02759977a4903301d0196b5e9f7aea39..407680b28d4a5843affce0e38d1cf36c4d9dd3a5 100644 (file)
@@ -32,7 +32,7 @@ Print the usage message.
 .BI "\-l" "" ", \-\-list" ""
 .IP
 For each spl.ko subsystem, print all available test names and
-hexidecimal identifiers with a short description.
+hexadecimal identifiers with a short description.
 .HP
 .BI "\-t" " subsystem" ":" "test" ", \-\-test" " subsystem" ":" "test"
 .HP
@@ -42,9 +42,9 @@ Run the \fItest\fR diagnostic routine for the spl.ko \fIsubsystem\fR.
 Specify this option more than once to run multiple tests.
 
 The \fItest\fR and \fIsubsystem\fR parameters are the names or
-hexidecimal identifiers returned by the \fBsplat --list\fR command.
+hexadecimal identifiers returned by the \fBsplat --list\fR command.
 
-If \fIsubsystem\fR is a name and not a hexidecimal identifier, then the
+If \fIsubsystem\fR is a name and not a hexadecimal identifier, then the
 \fBall\fR keyword can be used to run all available \fIsubsystem\fR
 tests.
 
@@ -73,7 +73,7 @@ Test the kernel compression and queue waiting facilities:
 # splat --test zlib:compress/uncompress --test taskq:wait
 .LP
 This is the same as the previous command, except that the subsystems
-and tests are referenced by hexidecimal identifier instead of by name:
+and tests are referenced by hexadecimal identifier instead of by name:
 .IP
 # splat -t 0x0f00:0x0f01 -t 0x0200:0x0204
 
index 97241fd53780e858a7bf408e8457efb90e6d9a63..30d9fc754454af1a4fea5c7c173f1d01f74c6d2f 100644 (file)
@@ -2,7 +2,7 @@
 .\"
 .\" Copyright 2013 Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
 .\"
-.TH SPL-MODULE-PARAMETERS 5 "Nov 18, 2013"
+.TH SPL-MODULE-PARAMETERS 5 "Oct 28, 2017"
 .SH NAME
 spl\-module\-parameters \- SPL module parameters
 .SH DESCRIPTION
@@ -153,7 +153,7 @@ function takes a single global lock over the entire virtual address range
 which serializes all allocations.  Using slightly different allocation
 functions for small and large objects allows us to handle a wide range of
 object sizes.
-.sh
+.sp
 The \fBspl_kmem_cache_kmem_limit\fR value is used to determine this cutoff
 size.  One quarter the PAGE_SIZE is used as the default value because
 \fBspl_kmem_cache_obj_per_slab\fR defaults to 16.  This means that at
@@ -250,6 +250,20 @@ may be overridden for non-standard configurations.
 Default value: \fB/etc/hostid\fR
 .RE
 
+.sp
+.ne 2
+.na
+\fBspl_panic_halt\fR (uint)
+.ad
+.RS 12n
+Cause a kernel panic on assertion failures. When not enabled, the thread is 
+halted to facilitate further debugging.
+.sp
+Set to a non-zero value to enable.
+.sp
+Default value: \fB0\fR
+.RE
+
 .sp
 .ne 2
 .na
index 1b6a7df9b34858cf4bc3d256da7770588c75685f..e306915a67772e9c49ef6ecb0f16547302312a56 100644 (file)
@@ -264,7 +264,7 @@ kstat_seq_show_io(struct seq_file *f, kstat_io_t *kip)
                    kip->nread, kip->nwritten,
                    kip->reads, kip->writes,
                    kip->wtime, kip->wlentime, kip->wlastupdate,
-                   kip->rtime, kip->wlentime, kip->rlastupdate,
+                   kip->rtime, kip->rlentime, kip->rlastupdate,
                    kip->wcnt,  kip->rcnt);
 
         return 0;
index 86915e62f2252ccf4bb6dea4988bb9de68fa4c3c..7cad9f76b54327ba66516a0c90913353560a1d08 100644 (file)
@@ -337,19 +337,18 @@ taskq_find_list(taskq_t *tq, struct list_head *lh, taskqid_t id)
 
 /*
  * Find an already dispatched task given the task id regardless of what
- * state it is in.  If a task is still pending or executing it will be
- * returned and 'active' set appropriately.  If the task has already
- * been run then NULL is returned.
+ * state it is in.  If a task is still pending it will be returned.
+ * If a task is executing, then -EBUSY will be returned instead.
+ * If the task has already been run then NULL is returned.
  */
 static taskq_ent_t *
-taskq_find(taskq_t *tq, taskqid_t id, int *active)
+taskq_find(taskq_t *tq, taskqid_t id)
 {
        taskq_thread_t *tqt;
        struct list_head *l;
        taskq_ent_t *t;
 
        ASSERT(spin_is_locked(&tq->tq_lock));
-       *active = 0;
 
        t = taskq_find_list(tq, &tq->tq_delay_list, id);
        if (t)
@@ -366,9 +365,12 @@ taskq_find(taskq_t *tq, taskqid_t id, int *active)
        list_for_each(l, &tq->tq_active_list) {
                tqt = list_entry(l, taskq_thread_t, tqt_active_list);
                if (tqt->tqt_id == id) {
-                       t = tqt->tqt_task;
-                       *active = 1;
-                       return (t);
+                       /*
+                        * Instead of returning tqt_task, we just return a non
+                        * NULL value to prevent misuse, since tqt_task only
+                        * has two valid fields.
+                        */
+                       return (ERR_PTR(-EBUSY));
                }
        }
 
@@ -405,12 +407,11 @@ taskq_find(taskq_t *tq, taskqid_t id, int *active)
 static int
 taskq_wait_id_check(taskq_t *tq, taskqid_t id)
 {
-       int active = 0;
        int rc;
        unsigned long flags;
 
        spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class);
-       rc = (taskq_find(tq, id, &active) == NULL);
+       rc = (taskq_find(tq, id) == NULL);
        spin_unlock_irqrestore(&tq->tq_lock, flags);
 
        return (rc);
@@ -497,15 +498,14 @@ int
 taskq_cancel_id(taskq_t *tq, taskqid_t id)
 {
        taskq_ent_t *t;
-       int active = 0;
        int rc = ENOENT;
        unsigned long flags;
 
        ASSERT(tq);
 
        spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class);
-       t = taskq_find(tq, id, &active);
-       if (t && !active) {
+       t = taskq_find(tq, id);
+       if (t && t != ERR_PTR(-EBUSY)) {
                list_del_init(&t->tqent_list);
                t->tqent_flags |= TQENT_FLAG_CANCEL;
 
@@ -536,7 +536,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t id)
        }
        spin_unlock_irqrestore(&tq->tq_lock, flags);
 
-       if (active) {
+       if (t == ERR_PTR(-EBUSY)) {
                taskq_wait_id(tq, id);
                rc = EBUSY;
        }
@@ -844,6 +844,7 @@ taskq_thread(void *args)
        taskq_ent_t *t;
        int seq_tasks = 0;
        unsigned long flags;
+       taskq_ent_t dup_task = {};
 
        ASSERT(tqt);
        ASSERT(tqt->tqt_tq);
@@ -903,22 +904,24 @@ taskq_thread(void *args)
                        list_del_init(&t->tqent_list);
 
                        /*
-                        * In order to support recursively dispatching a
-                        * preallocated taskq_ent_t, tqent_id must be
-                        * stored prior to executing tqent_func.
+                        * A TQENT_FLAG_PREALLOC task may be reused or freed
+                        * during the task function call. Store tqent_id and
+                        * tqent_flags here.
+                        *
+                        * Also use an on stack taskq_ent_t for tqt_task
+                        * assignment in this case. We only populate the two
+                        * fields used by the only user in taskq proc file.
                         */
                        tqt->tqt_id = t->tqent_id;
-                       tqt->tqt_task = t;
-
-                       /*
-                        * We must store a copy of the flags prior to
-                        * servicing the task (servicing a prealloc'd task
-                        * returns the ownership of the tqent back to
-                        * the caller of taskq_dispatch). Thus,
-                        * tqent_flags _may_ change within the call.
-                        */
                        tqt->tqt_flags = t->tqent_flags;
 
+                       if (t->tqent_flags & TQENT_FLAG_PREALLOC) {
+                               dup_task.tqent_func = t->tqent_func;
+                               dup_task.tqent_arg = t->tqent_arg;
+                               t = &dup_task;
+                       }
+                       tqt->tqt_task = t;
+
                        taskq_insert_in_order(tq, tqt);
                        tq->tq_nactive++;
                        spin_unlock_irqrestore(&tq->tq_lock, flags);
index 346e63c0f1613a4af068338595db08de59fdc439..ca19d7343ca0fc0a4e7c0b12fb1d154c79cd4e0f 100644 (file)
@@ -211,35 +211,22 @@ int
 vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off,
        uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp)
 {
-       loff_t offset;
-       mm_segment_t saved_fs;
-       struct file *fp;
+       struct file *fp = vp->v_file;
+       loff_t offset = off;
        int rc;
 
        ASSERT(uio == UIO_WRITE || uio == UIO_READ);
-       ASSERT(vp);
-       ASSERT(vp->v_file);
        ASSERT(seg == UIO_SYSSPACE);
        ASSERT((ioflag & ~FAPPEND) == 0);
 
-       fp = vp->v_file;
-
-       offset = off;
        if (ioflag & FAPPEND)
                offset = fp->f_pos;
 
-       /* Writable user data segment must be briefly increased for this
-        * process so we can use the user space read call paths to write
-        * in to memory allocated by the kernel. */
-       saved_fs = get_fs();
-        set_fs(get_ds());
-
        if (uio & UIO_WRITE)
-               rc = vfs_write(fp, addr, len, &offset);
+               rc = spl_kernel_write(fp, addr, len, &offset);
        else
-               rc = vfs_read(fp, addr, len, &offset);
+               rc = spl_kernel_read(fp, addr, len, &offset);
 
-       set_fs(saved_fs);
        fp->f_pos = offset;
 
        if (rc < 0)
index 03d131eac55f7a986d469f0dcde5deb7fa8d2491..2ebe8e5e3dcff4a6329dc26fb4ec13e6f2d587a3 100644 (file)
@@ -167,6 +167,9 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
+- Released 0.7.4-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
 * Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
 - Released 0.7.3-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
index 55ec810a1c2df3034d7476e5b30088fafa3c2e21..63354663fe616436c6d4087b0a4bcfd2896bacd4 100644 (file)
@@ -34,6 +34,9 @@ make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
+- Released 0.7.4-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
 * Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
 - Released 0.7.3-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
index 55ec810a1c2df3034d7476e5b30088fafa3c2e21..63354663fe616436c6d4087b0a4bcfd2896bacd4 100644 (file)
@@ -34,6 +34,9 @@ make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
+- Released 0.7.4-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
 * Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
 - Released 0.7.3-1, detailed release notes are available at:
 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
index a35988f98af1bca04bd1df931dd26fd891ad93a0..d3098bb3a41aa2db30428ccc93bfe8e9e68c561b 100644 (file)
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* kernel_read() take loff_t pointer */
+#undef HAVE_KERNEL_READ_PPOS
+
+/* kernel_write() take loff_t pointer */
+#undef HAVE_KERNEL_WRITE_PPOS
+
 /* struct kmem_cache has allocflags */
 #undef HAVE_KMEM_CACHE_ALLOCFLAGS