From: Aron Xu Date: Mon, 18 Dec 2017 14:04:40 +0000 (+0800) Subject: New upstream version 0.7.4 X-Git-Tag: debian/0.7.9-2~19^2 X-Git-Url: https://git.proxmox.com/?p=mirror_spl-debian.git;a=commitdiff_plain;h=99d6d8dce6e1eca0928c72cf09677b244a90cb46 New upstream version 0.7.4 --- diff --git a/META b/META index 4aae365..a55e57f 100644 --- 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 diff --git a/config/spl-build.m4 b/config/spl-build.m4 index b2a50bf..accf675 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -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 + ],[ + 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 + ],[ + 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" +]) diff --git a/configure b/configure index fabccd0..9f80baf 100755 --- 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 @@ -15276,6 +15276,158 @@ fi + + { $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 + +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 + +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) @@ -18854,6 +19006,158 @@ fi + { $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 + +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 + +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 ." _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'`\\" diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index 9165145..2fd6e5f 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -26,6 +26,7 @@ #define _SPL_FILE_COMPAT_H #include +#include #ifdef HAVE_FDTABLE_HEADER #include #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 diff --git a/man/man1/splat.1 b/man/man1/splat.1 index 37f8435..407680b 100644 --- a/man/man1/splat.1 +++ b/man/man1/splat.1 @@ -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 diff --git a/man/man5/spl-module-parameters.5 b/man/man5/spl-module-parameters.5 index 97241fd..30d9fc7 100644 --- a/man/man5/spl-module-parameters.5 +++ b/man/man5/spl-module-parameters.5 @@ -2,7 +2,7 @@ .\" .\" Copyright 2013 Turbo Fredriksson . 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 diff --git a/module/spl/spl-kstat.c b/module/spl/spl-kstat.c index 1b6a7df..e306915 100644 --- a/module/spl/spl-kstat.c +++ b/module/spl/spl-kstat.c @@ -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; diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 86915e6..7cad9f7 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -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); diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 346e63c..ca19d73 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -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) diff --git a/rpm/generic/spl-kmod.spec.in b/rpm/generic/spl-kmod.spec.in index 03d131e..2ebe8e5 100644 --- a/rpm/generic/spl-kmod.spec.in +++ b/rpm/generic/spl-kmod.spec.in @@ -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 - 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 - 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 diff --git a/rpm/generic/spl.spec.in b/rpm/generic/spl.spec.in index 55ec810..6335466 100644 --- a/rpm/generic/spl.spec.in +++ b/rpm/generic/spl.spec.in @@ -34,6 +34,9 @@ make install DESTDIR=%{?buildroot} %{_mandir}/man5/* %changelog +* Thu Dec 07 2017 Tony Hutter - 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 - 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 diff --git a/rpm/redhat/spl.spec.in b/rpm/redhat/spl.spec.in index 55ec810..6335466 100644 --- a/rpm/redhat/spl.spec.in +++ b/rpm/redhat/spl.spec.in @@ -34,6 +34,9 @@ make install DESTDIR=%{?buildroot} %{_mandir}/man5/* %changelog +* Thu Dec 07 2017 Tony Hutter - 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 - 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 diff --git a/spl_config.h.in b/spl_config.h.in index a35988f..d3098bb 100644 --- a/spl_config.h.in +++ b/spl_config.h.in @@ -78,6 +78,12 @@ /* Define to 1 if you have the 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