]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Imported Upstream version 0.6.5.5
authorAron Xu <aron@debian.org>
Sun, 20 Mar 2016 14:50:19 +0000 (22:50 +0800)
committerAron Xu <aron@debian.org>
Sun, 20 Mar 2016 14:50:19 +0000 (22:50 +0800)
12 files changed:
META
configure
copy-builtin
include/sys/kmem.h
include/sys/types.h
module/spl/spl-condvar.c
module/spl/spl-kmem-cache.c
module/splat/splat-condvar.c
rpm/generic/spl-kmod.spec.in
rpm/generic/spl.spec.in
rpm/redhat/spl-kmod.spec.in
rpm/redhat/spl.spec.in

diff --git a/META b/META
index f5fe29d6e24e0221f0edfe4c29891b5a5662e778..cd930474156b5d653788497d843aa57d29f090b1 100644 (file)
--- a/META
+++ b/META
@@ -1,7 +1,7 @@
 Meta:         1
 Name:         spl
 Branch:       1.0
-Version:      0.6.5.4
+Version:      0.6.5.5
 Release:      1
 Release-Tags: relext
 License:      GPL
index d67a04e913e2c189246d8ac3bd196e412b6f9791..7fd772db5bc65666cb9cac57526e1455d810ee2f 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.68 for spl 0.6.5.4.
+# Generated by GNU Autoconf 2.68 for spl 0.6.5.5.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -567,8 +567,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='spl'
 PACKAGE_TARNAME='spl'
-PACKAGE_VERSION='0.6.5.4'
-PACKAGE_STRING='spl 0.6.5.4'
+PACKAGE_VERSION='0.6.5.5'
+PACKAGE_STRING='spl 0.6.5.5'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1357,7 +1357,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.6.5.4 to adapt to many kinds of systems.
+\`configure' configures spl 0.6.5.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1428,7 +1428,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of spl 0.6.5.4:";;
+     short | recursive ) echo "Configuration of spl 0.6.5.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1545,7 +1545,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-spl configure 0.6.5.4
+spl configure 0.6.5.5
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1823,7 +1823,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.6.5.4, which was
+It was created by spl $as_me 0.6.5.5, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2947,7 +2947,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='spl'
- VERSION='0.6.5.4'
+ VERSION='0.6.5.5'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -17462,7 +17462,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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.6.5.4, which was
+This file was extended by spl $as_me 0.6.5.5, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17528,7 +17528,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-spl config.status 0.6.5.4
+spl config.status 0.6.5.5
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
index aa4307386688e9c2971abaf7ee345e731d6c6d81..34c482bab697cf1672617e79a9a19940c46a9804 100755 (executable)
@@ -116,7 +116,7 @@ add_after()
 add_after "$KERNEL_DIR/Kconfig" 'source "arch/$SRCARCH/Kconfig"' 'source "spl/Kconfig"'
 # We must take care to build SPL before ZFS, otherwise the symbols required
 # to link ZFS will not be available.
-sed -i 's#+= kernel/#+= kernel/ spl/#' "$KERNEL_DIR/Makefile"
+sed -i 's~mm/ fs/~mm/ spl/ fs/~' "$KERNEL_DIR/Makefile"
 
 echo >&2
 echo "    $0: done." >&2
index 8d5e729373fa265a14f393280df89d2aecbed9b3..d4b3bf680a454528ec9514258b6d4e193582eaf7 100644 (file)
@@ -78,14 +78,20 @@ typedef struct {
        unsigned int saved_flags;
 } fstrans_cookie_t;
 
+#ifdef PF_MEMALLOC_NOIO
+#define        SPL_FSTRANS (PF_FSTRANS|PF_MEMALLOC_NOIO)
+#else
+#define        SPL_FSTRANS (PF_FSTRANS)
+#endif
+
 static inline fstrans_cookie_t
 spl_fstrans_mark(void)
 {
        fstrans_cookie_t cookie;
 
        cookie.fstrans_thread = current;
-       cookie.saved_flags = current->flags & PF_FSTRANS;
-       current->flags |= PF_FSTRANS;
+       cookie.saved_flags = current->flags & SPL_FSTRANS;
+       current->flags |= SPL_FSTRANS;
 
        return (cookie);
 }
@@ -94,9 +100,9 @@ static inline void
 spl_fstrans_unmark(fstrans_cookie_t cookie)
 {
        ASSERT3P(cookie.fstrans_thread, ==, current);
-       ASSERT(current->flags & PF_FSTRANS);
+       ASSERT((current->flags & SPL_FSTRANS) == SPL_FSTRANS);
 
-       current->flags &= ~(PF_FSTRANS);
+       current->flags &= ~SPL_FSTRANS;
        current->flags |= cookie.saved_flags;
 }
 
index ec0455cdcf6667cf042cabc47579bd43b146bae6..d718ca0fad45ea45f4a7eb2849162f8f33e45099 100644 (file)
@@ -58,7 +58,6 @@ typedef longlong_t                    diskaddr_t;
 typedef ushort_t                       o_mode_t;
 typedef uint_t                         major_t;
 typedef uint_t                         minor_t;
-typedef ulong_t                                pfn_t;
 typedef ulong_t                                pgcnt_t;
 typedef long                           spgcnt_t;
 typedef short                          index_t;
index c3467a56e6ae2ceff81f8b10aff9f41e61c50656..c420d18cadfe14f61cf01dec57e119bd0be401e4 100644 (file)
@@ -80,6 +80,7 @@ static void
 cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io)
 {
        DEFINE_WAIT(wait);
+       kmutex_t *m;
 
        ASSERT(cvp);
        ASSERT(mp);
@@ -87,11 +88,11 @@ cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io)
        ASSERT(mutex_owned(mp));
        atomic_inc(&cvp->cv_refs);
 
-       if (cvp->cv_mutex == NULL)
-               cvp->cv_mutex = mp;
-
+       m = ACCESS_ONCE(cvp->cv_mutex);
+       if (!m)
+               m = xchg(&cvp->cv_mutex, mp);
        /* Ensure the same mutex is used by all callers */
-       ASSERT(cvp->cv_mutex == mp);
+       ASSERT(m == NULL || m == mp);
 
        prepare_to_wait_exclusive(&cvp->cv_event, &wait, state);
        atomic_inc(&cvp->cv_waiters);
@@ -106,16 +107,25 @@ cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io)
                io_schedule();
        else
                schedule();
-       mutex_enter(mp);
 
        /* No more waiters a different mutex could be used */
        if (atomic_dec_and_test(&cvp->cv_waiters)) {
+               /*
+                * This is set without any lock, so it's racy. But this is
+                * just for debug anyway, so make it best-effort
+                */
                cvp->cv_mutex = NULL;
                wake_up(&cvp->cv_destroy);
        }
 
        finish_wait(&cvp->cv_event, &wait);
        atomic_dec(&cvp->cv_refs);
+
+       /*
+        * Hold mutex after we release the cvp, otherwise we could dead lock
+        * with a thread holding the mutex and call cv_destroy.
+        */
+       mutex_enter(mp);
 }
 
 void
@@ -148,6 +158,7 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
     int state)
 {
        DEFINE_WAIT(wait);
+       kmutex_t *m;
        clock_t time_left;
 
        ASSERT(cvp);
@@ -156,15 +167,16 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
        ASSERT(mutex_owned(mp));
        atomic_inc(&cvp->cv_refs);
 
-       if (cvp->cv_mutex == NULL)
-               cvp->cv_mutex = mp;
-
+       m = ACCESS_ONCE(cvp->cv_mutex);
+       if (!m)
+               m = xchg(&cvp->cv_mutex, mp);
        /* Ensure the same mutex is used by all callers */
-       ASSERT(cvp->cv_mutex == mp);
+       ASSERT(m == NULL || m == mp);
 
        /* XXX - Does not handle jiffie wrap properly */
        time_left = expire_time - jiffies;
        if (time_left <= 0) {
+               /* XXX - doesn't reset cv_mutex */
                atomic_dec(&cvp->cv_refs);
                return (-1);
        }
@@ -179,10 +191,13 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
         */
        mutex_exit(mp);
        time_left = schedule_timeout(time_left);
-       mutex_enter(mp);
 
        /* No more waiters a different mutex could be used */
        if (atomic_dec_and_test(&cvp->cv_waiters)) {
+               /*
+                * This is set without any lock, so it's racy. But this is
+                * just for debug anyway, so make it best-effort
+                */
                cvp->cv_mutex = NULL;
                wake_up(&cvp->cv_destroy);
        }
@@ -190,6 +205,11 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
        finish_wait(&cvp->cv_event, &wait);
        atomic_dec(&cvp->cv_refs);
 
+       /*
+        * Hold mutex after we release the cvp, otherwise we could dead lock
+        * with a thread holding the mutex and call cv_destroy.
+        */
+       mutex_enter(mp);
        return (time_left > 0 ? time_left : -1);
 }
 
@@ -216,6 +236,7 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time,
     int state)
 {
        DEFINE_WAIT(wait);
+       kmutex_t *m;
        hrtime_t time_left, now;
        unsigned long time_left_us;
 
@@ -225,11 +246,11 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time,
        ASSERT(mutex_owned(mp));
        atomic_inc(&cvp->cv_refs);
 
-       if (cvp->cv_mutex == NULL)
-               cvp->cv_mutex = mp;
-
+       m = ACCESS_ONCE(cvp->cv_mutex);
+       if (!m)
+               m = xchg(&cvp->cv_mutex, mp);
        /* Ensure the same mutex is used by all callers */
-       ASSERT(cvp->cv_mutex == mp);
+       ASSERT(m == NULL || m == mp);
 
        now = gethrtime();
        time_left = expire_time - now;
@@ -253,10 +274,13 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time,
         * interrupts
         */
        usleep_range(time_left_us, time_left_us + 100);
-       mutex_enter(mp);
 
        /* No more waiters a different mutex could be used */
        if (atomic_dec_and_test(&cvp->cv_waiters)) {
+               /*
+                * This is set without any lock, so it's racy. But this is
+                * just for debug anyway, so make it best-effort
+                */
                cvp->cv_mutex = NULL;
                wake_up(&cvp->cv_destroy);
        }
@@ -264,6 +288,7 @@ __cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t expire_time,
        finish_wait(&cvp->cv_event, &wait);
        atomic_dec(&cvp->cv_refs);
 
+       mutex_enter(mp);
        time_left = expire_time - gethrtime();
        return (time_left > 0 ? time_left : -1);
 }
index 323711df4fc97ca1964d9cfe72b5c64c4f6c92e0..b58f128cbde5d071323e06c15d60a2f201c8db9f 100644 (file)
@@ -1630,16 +1630,11 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count)
        atomic_inc(&skc->skc_ref);
 
        /*
-        * Execute the registered reclaim callback if it exists.  The
-        * per-cpu caches will be drained when is set KMC_EXPIRE_MEM.
+        * Execute the registered reclaim callback if it exists.
         */
        if (skc->skc_flags & KMC_SLAB) {
                if (skc->skc_reclaim)
                        skc->skc_reclaim(skc->skc_private);
-
-               if (spl_kmem_cache_expire & KMC_EXPIRE_MEM)
-                       kmem_cache_shrink(skc->skc_linux_cache);
-
                goto out;
        }
 
index ed633acdaa8d3b5de386366851b7e3371cb50b1c..3ffa1c79fb1152880d802eb2fc932a0b4746dcf3 100644 (file)
@@ -88,6 +88,9 @@ splat_condvar_test12_thread(void *arg)
            ct->ct_thread->comm, atomic_read(&cv->cv_condvar.cv_waiters));
        mutex_exit(&cv->cv_mtx);
 
+       /* wait for main thread reap us */
+       while (!kthread_should_stop())
+               schedule();
        return 0;
 }
 
@@ -151,6 +154,12 @@ splat_condvar_test1(struct file *file, void *arg)
        /* Wake everything for the failure case */
        cv_broadcast(&cv.cv_condvar);
        cv_destroy(&cv.cv_condvar);
+
+       /* wait for threads to exit */
+       for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) {
+               if (!IS_ERR(ct[i].ct_thread))
+                       kthread_stop(ct[i].ct_thread);
+       }
        mutex_destroy(&cv.cv_mtx);
 
        return rc;
@@ -199,6 +208,12 @@ splat_condvar_test2(struct file *file, void *arg)
 
        /* Wake everything for the failure case */
        cv_destroy(&cv.cv_condvar);
+
+       /* wait for threads to exit */
+       for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) {
+               if (!IS_ERR(ct[i].ct_thread))
+                       kthread_stop(ct[i].ct_thread);
+       }
        mutex_destroy(&cv.cv_mtx);
 
        return rc;
@@ -234,6 +249,9 @@ splat_condvar_test34_thread(void *arg)
 
        mutex_exit(&cv->cv_mtx);
 
+       /* wait for main thread reap us */
+       while (!kthread_should_stop())
+               schedule();
        return 0;
 }
 
@@ -302,6 +320,12 @@ splat_condvar_test3(struct file *file, void *arg)
        /* Wake everything for the failure case */
        cv_broadcast(&cv.cv_condvar);
        cv_destroy(&cv.cv_condvar);
+
+       /* wait for threads to exit */
+       for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) {
+               if (!IS_ERR(ct[i].ct_thread))
+                       kthread_stop(ct[i].ct_thread);
+       }
        mutex_destroy(&cv.cv_mtx);
 
        return rc;
@@ -372,6 +396,12 @@ splat_condvar_test4(struct file *file, void *arg)
        /* Wake everything for the failure case */
        cv_broadcast(&cv.cv_condvar);
        cv_destroy(&cv.cv_condvar);
+
+       /* wait for threads to exit */
+       for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) {
+               if (!IS_ERR(ct[i].ct_thread))
+                       kthread_stop(ct[i].ct_thread);
+       }
        mutex_destroy(&cv.cv_mtx);
 
        return rc;
index d4441b88d1309cbac7a3bbbc13b85d61cd719492..90632e2039071fe789f4514e3f4b27a3e23b08c2 100644 (file)
@@ -152,6 +152,8 @@ for kernel_version in %{?kernel_versions}; do
         INSTALL_MOD_DIR=%{kmodinstdir_postfix}
     cd ..
 done
+
+# find-debuginfo.sh only considers executables
 chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 %{?akmod_install}
 
@@ -160,6 +162,13 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Wed Mar 9 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.5-1
+- Linux 4.5 compatibility zfsonlinux/spl#524
+- Create working debuginfo packages on Red Hat zfsonlinux/zfs#4224
+- Allow copy-builtin to run multiple times zfsonlinux/spl#526
+- Use safer flags for in-kernel memory allocations zfsonlinux/spl#523
+- Fix potential deadlock in cv_wait() zfsonlinux/zfs#4106
+- Fix livelock in shrinker zfsonlinux/zfs#3936
 * Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
 - Build fixes on SPARC and some kernels
 - Fix taskq dynamic spawning deadlock
index 6beebb15c595c2b2af0f6fc1d099d4cabfbad708..701035677f7984e066b5229bae8c462901e0ea6b 100644 (file)
@@ -38,6 +38,13 @@ make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Wed Mar 9 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.5-1
+- Linux 4.5 compatibility zfsonlinux/spl#524
+- Create working debuginfo packages on Red Hat zfsonlinux/zfs#4224
+- Allow copy-builtin to run multiple times zfsonlinux/spl#526
+- Use safer flags for in-kernel memory allocations zfsonlinux/spl#523
+- Fix potential deadlock in cv_wait() zfsonlinux/zfs#4106
+- Fix livelock in shrinker zfsonlinux/zfs#3936
 * Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
 - Build fixes on SPARC and some kernels
 - Fix taskq dynamic spawning deadlock
index 3935285979e3847b8ce6ed0ba38ce393f883e4a1..6fcc4a898b55dcfe82ba1ad0bf3b43a546d77f57 100644 (file)
@@ -27,7 +27,6 @@ This package contains the kernel modules required to emulate
 several interfaces provided by the Solaris kernel.
 
 %define kmod_name spl
-%define debug_package %{nil}
 
 %kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
 
@@ -96,6 +95,8 @@ make install \
         DESTDIR=${RPM_BUILD_ROOT} \
         INSTALL_MOD_DIR=extra/%{kmod_name}
 %{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
+# find-debuginfo.sh only considers executables
+%{__chmod} u+x  %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
 
 %clean
 rm -rf $RPM_BUILD_ROOT
index 6beebb15c595c2b2af0f6fc1d099d4cabfbad708..701035677f7984e066b5229bae8c462901e0ea6b 100644 (file)
@@ -38,6 +38,13 @@ make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Wed Mar 9 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.5-1
+- Linux 4.5 compatibility zfsonlinux/spl#524
+- Create working debuginfo packages on Red Hat zfsonlinux/zfs#4224
+- Allow copy-builtin to run multiple times zfsonlinux/spl#526
+- Use safer flags for in-kernel memory allocations zfsonlinux/spl#523
+- Fix potential deadlock in cv_wait() zfsonlinux/zfs#4106
+- Fix livelock in shrinker zfsonlinux/zfs#3936
 * Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
 - Build fixes on SPARC and some kernels
 - Fix taskq dynamic spawning deadlock