From 1c5de20ae2511124613926e4f780572634818218 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 20 Mar 2012 16:00:17 -0700 Subject: [PATCH] Add --enable-debug-dmu-tx configure option Allow rigorous (and expensive) tx validation to be enabled/disabled indepentantly from the standard zfs debugging. When enabled these checks ensure that all txs are constructed properly and that a dbuf is never dirtied without taking the correct tx hold. This checking is particularly helpful when adding new dmu consumers like Lustre. However, for established consumers such as the zpl with no known outstanding tx construction problems this is just overhead. --enable-debug-dmu-tx - Enable/disable validation of each tx as --disable-debug-dmu-tx it is constructed. By default validation is disabled due to performance concerns. Signed-off-by: Brian Behlendorf --- Makefile.in | 2 + cmd/Makefile.in | 1 + cmd/mount_zfs/Makefile.in | 1 + cmd/sas_switch_id/Makefile.in | 1 + cmd/zdb/Makefile.in | 1 + cmd/zfs/Makefile.in | 1 + cmd/zinject/Makefile.in | 1 + cmd/zpios/Makefile.in | 1 + cmd/zpool/Makefile.in | 1 + cmd/zpool_id/Makefile.in | 1 + cmd/zpool_layout/Makefile.in | 1 + cmd/ztest/Makefile.in | 1 + cmd/zvol_id/Makefile.in | 1 + config/rpm.am | 1 + config/zfs-build.m4 | 23 ++++++++ configure | 63 ++++++++++++++++----- configure.ac | 1 + dracut/90zfs/Makefile.in | 1 + dracut/Makefile.in | 1 + etc/Makefile.in | 1 + etc/init.d/Makefile.in | 1 + etc/zfs/Makefile.in | 1 + include/Makefile.in | 1 + include/linux/Makefile.in | 1 + include/sys/Makefile.in | 1 + include/sys/dmu_tx.h | 6 +- include/sys/fm/Makefile.in | 1 + include/sys/fm/fs/Makefile.in | 1 + include/sys/fs/Makefile.in | 1 + lib/Makefile.in | 1 + lib/libavl/Makefile.in | 1 + lib/libefi/Makefile.in | 1 + lib/libnvpair/Makefile.in | 1 + lib/libshare/Makefile.in | 1 + lib/libspl/Makefile.in | 1 + lib/libspl/asm-generic/Makefile.in | 1 + lib/libspl/asm-i386/Makefile.in | 1 + lib/libspl/asm-x86_64/Makefile.in | 1 + lib/libspl/include/Makefile.in | 1 + lib/libspl/include/ia32/Makefile.in | 1 + lib/libspl/include/ia32/sys/Makefile.in | 1 + lib/libspl/include/rpc/Makefile.in | 1 + lib/libspl/include/sys/Makefile.in | 1 + lib/libspl/include/sys/dktp/Makefile.in | 1 + lib/libspl/include/sys/sysevent/Makefile.in | 1 + lib/libspl/include/util/Makefile.in | 1 + lib/libunicode/Makefile.in | 1 + lib/libuutil/Makefile.in | 1 + lib/libzfs/Makefile.in | 1 + lib/libzpool/Makefile.in | 1 + man/Makefile.in | 1 + man/man8/Makefile.in | 1 + module/zfs/dmu_tx.c | 14 ++--- scripts/Makefile.in | 1 + scripts/zpios-profile/Makefile.in | 1 + scripts/zpios-test/Makefile.in | 1 + scripts/zpool-config/Makefile.in | 1 + scripts/zpool-layout/Makefile.in | 1 + udev/Makefile.in | 1 + udev/rules.d/Makefile.in | 1 + zfs-modules.spec.in | 13 ++++- zfs_config.h.in | 3 + 62 files changed, 154 insertions(+), 25 deletions(-) diff --git a/Makefile.in b/Makefile.in index 077d318eb2..ed37c99de2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -209,6 +209,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ @@ -964,6 +965,7 @@ rpm-common: --define "require_splobj $(SPL_OBJ)" \ --define "require_splver $(SPL_VERSION)" \ --define "$(DEBUG_ZFS) 1" \ + --define "$(DEBUG_DMU_TX) 1" \ --nodeps --rebuild $$rpmpkg || exit 1; \ cp $$rpmbuild/RPMS/*/* . || exit 1; \ $(RM) -R $$rpmbuild diff --git a/cmd/Makefile.in b/cmd/Makefile.in index 76a5731a30..17cdb6fb93 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in index ecc61d1531..eec29d9880 100644 --- a/cmd/mount_zfs/Makefile.in +++ b/cmd/mount_zfs/Makefile.in @@ -165,6 +165,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/sas_switch_id/Makefile.in b/cmd/sas_switch_id/Makefile.in index 375c65ec1a..ba8a2d9593 100644 --- a/cmd/sas_switch_id/Makefile.in +++ b/cmd/sas_switch_id/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in index ae4e2c9128..11191a08b6 100644 --- a/cmd/zdb/Makefile.in +++ b/cmd/zdb/Makefile.in @@ -167,6 +167,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in index 4452a967fd..1a6317e231 100644 --- a/cmd/zfs/Makefile.in +++ b/cmd/zfs/Makefile.in @@ -167,6 +167,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in index 5e200d1dbf..2937aad211 100644 --- a/cmd/zinject/Makefile.in +++ b/cmd/zinject/Makefile.in @@ -167,6 +167,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in index c7507a17d4..c260ca672d 100644 --- a/cmd/zpios/Makefile.in +++ b/cmd/zpios/Makefile.in @@ -161,6 +161,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in index 5775a4f29e..1ce79855fc 100644 --- a/cmd/zpool/Makefile.in +++ b/cmd/zpool/Makefile.in @@ -168,6 +168,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in index 3d51566cab..c5c523df22 100644 --- a/cmd/zpool_id/Makefile.in +++ b/cmd/zpool_id/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in index 077f1d25ee..f6d7679db6 100644 --- a/cmd/zpool_layout/Makefile.in +++ b/cmd/zpool_layout/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in index 405e496eee..8364639ecc 100644 --- a/cmd/ztest/Makefile.in +++ b/cmd/ztest/Makefile.in @@ -167,6 +167,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/cmd/zvol_id/Makefile.in b/cmd/zvol_id/Makefile.in index 6f6688f7ae..9e59035bed 100644 --- a/cmd/zvol_id/Makefile.in +++ b/cmd/zvol_id/Makefile.in @@ -161,6 +161,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/config/rpm.am b/config/rpm.am index d557f77b4a..41107d5eeb 100644 --- a/config/rpm.am +++ b/config/rpm.am @@ -69,6 +69,7 @@ rpm-common: --define "require_splobj $(SPL_OBJ)" \ --define "require_splver $(SPL_VERSION)" \ --define "$(DEBUG_ZFS) 1" \ + --define "$(DEBUG_DMU_TX) 1" \ --nodeps --rebuild $$rpmpkg || exit 1; \ cp $$rpmbuild/RPMS/*/* . || exit 1; \ $(RM) -R $$rpmbuild diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index c5983d3c35..6bfea51951 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -37,6 +37,29 @@ AC_DEFUN([ZFS_AC_DEBUG], [ AC_MSG_RESULT([$enable_debug]) ]) +AC_DEFUN([ZFS_AC_DEBUG_DMU_TX], [ + AC_ARG_ENABLE([debug-dmu-tx], + [AS_HELP_STRING([--enable-debug-dmu-tx], + [Enable dmu tx validation @<:@default=no@:>@])], + [], + [enable_debug_dmu_tx=no]) + + AS_IF([test "x$enable_debug_dmu_tx" = xyes], + [ + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_DMU_TX" + DEBUG_DMU_TX="_with_debug_dmu_tx" + AC_DEFINE([DEBUG_DMU_TX], [1], + [Define to 1 to enabled dmu tx validation]) + ], + [ + DEBUG_DMU_TX="_without_debug_dmu_tx" + ]) + + AC_SUBST(DEBUG_DMU_TX) + AC_MSG_CHECKING([whether dmu tx validation is enabled]) + AC_MSG_RESULT([$enable_debug_dmu_tx]) +]) + AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE ]) diff --git a/configure b/configure index da28b4724e..d9bea44f07 100755 --- a/configure +++ b/configure @@ -787,6 +787,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +DEBUG_DMU_TX DEBUG_ZFS DEBUG_STACKFLAGS DEBUG_CFLAGS @@ -989,6 +990,7 @@ with_udevruledir with_blkid with_selinux enable_debug +enable_debug_dmu_tx ' ac_precious_vars='build_alias host_alias @@ -1642,6 +1644,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Enable generic debug support [default=no] + --enable-debug-dmu-tx Enable dmu tx validation [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -4836,13 +4839,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4839: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4842: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4842: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4845: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4845: output\"" >&5) + (eval echo "\"\$as_me:4848: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -6048,7 +6051,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6051 "configure"' > conftest.$ac_ext + echo '#line 6054 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7901,11 +7904,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7904: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7907: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7908: \$? = $ac_status" >&5 + echo "$as_me:7911: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8240,11 +8243,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8243: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8246: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8247: \$? = $ac_status" >&5 + echo "$as_me:8250: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8345,11 +8348,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8348: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8351: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8352: \$? = $ac_status" >&5 + echo "$as_me:8355: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8400,11 +8403,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8403: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8406: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8407: \$? = $ac_status" >&5 + echo "$as_me:8410: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11203,7 +11206,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11206 "configure" +#line 11209 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11299,7 +11302,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11302 "configure" +#line 11305 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -24014,6 +24017,38 @@ fi $as_echo "$enable_debug" >&6; } + # Check whether --enable-debug-dmu-tx was given. +if test "${enable_debug_dmu_tx+set}" = set; then + enableval=$enable_debug_dmu_tx; +else + enable_debug_dmu_tx=no +fi + + + if test "x$enable_debug_dmu_tx" = xyes; then + + KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_DMU_TX" + DEBUG_DMU_TX="_with_debug_dmu_tx" + +cat >>confdefs.h <<\_ACEOF +#define DEBUG_DMU_TX 1 +_ACEOF + + +else + + DEBUG_DMU_TX="_without_debug_dmu_tx" + +fi + + + + { $as_echo "$as_me:$LINENO: checking whether dmu tx validation is enabled" >&5 +$as_echo_n "checking whether dmu tx validation is enabled... " >&6; } + { $as_echo "$as_me:$LINENO: result: $enable_debug_dmu_tx" >&5 +$as_echo "$enable_debug_dmu_tx" >&6; } + + ac_config_files="$ac_config_files Makefile dracut/Makefile dracut/90zfs/Makefile udev/Makefile udev/rules.d/Makefile etc/Makefile etc/init.d/Makefile etc/zfs/Makefile man/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/Makefile lib/libshare/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/zpool_layout/Makefile cmd/zvol_id/Makefile cmd/zpool_id/Makefile cmd/sas_switch_id/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/zpool-layout/Makefile scripts/common.sh zfs.spec zfs-modules.spec PKGBUILD-zfs PKGBUILD-zfs-modules zfs-script-config.sh" diff --git a/configure.ac b/configure.ac index f59ea9332c..e0cb5a52dc 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,7 @@ ZFS_AC_LICENSE ZFS_AC_PACKAGE ZFS_AC_CONFIG ZFS_AC_DEBUG +ZFS_AC_DEBUG_DMU_TX AC_CONFIG_FILES([ Makefile diff --git a/dracut/90zfs/Makefile.in b/dracut/90zfs/Makefile.in index e34f65ac9f..2b9907cbd1 100644 --- a/dracut/90zfs/Makefile.in +++ b/dracut/90zfs/Makefile.in @@ -153,6 +153,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/dracut/Makefile.in b/dracut/Makefile.in index b8cc6ae617..fb9639ebd9 100644 --- a/dracut/Makefile.in +++ b/dracut/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/etc/Makefile.in b/etc/Makefile.in index 1187d0a2c8..3b0556d92b 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in index 8eb130fa21..5879775f01 100644 --- a/etc/init.d/Makefile.in +++ b/etc/init.d/Makefile.in @@ -153,6 +153,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in index 73025a193d..35bdc754ad 100644 --- a/etc/zfs/Makefile.in +++ b/etc/zfs/Makefile.in @@ -153,6 +153,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/Makefile.in b/include/Makefile.in index e1817127ad..b30a9708c7 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -213,6 +213,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index 3d47867750..28ead57375 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -160,6 +160,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index a179576897..1e04ddfa76 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -340,6 +340,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/sys/dmu_tx.h b/include/sys/dmu_tx.h index d87a09beca..40c1ded5de 100644 --- a/include/sys/dmu_tx.h +++ b/include/sys/dmu_tx.h @@ -60,7 +60,7 @@ struct dmu_tx { list_t tx_callbacks; /* list of dmu_tx_callback_t on this dmu_tx */ uint8_t tx_anyobj; int tx_err; -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX uint64_t tx_space_towrite; uint64_t tx_space_tofree; uint64_t tx_space_tooverwrite; @@ -91,7 +91,7 @@ typedef struct dmu_tx_hold { uint64_t txh_space_tounref; uint64_t txh_memory_tohold; uint64_t txh_fudge; -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX enum dmu_tx_hold_type txh_type; uint64_t txh_arg1; uint64_t txh_arg2; @@ -160,7 +160,7 @@ void dmu_tx_dirty_buf(dmu_tx_t *tx, struct dmu_buf_impl *db); int dmu_tx_holds(dmu_tx_t *tx, uint64_t object); void dmu_tx_hold_space(dmu_tx_t *tx, uint64_t space); -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX #define DMU_TX_DIRTY_BUF(tx, db) dmu_tx_dirty_buf(tx, db) #else #define DMU_TX_DIRTY_BUF(tx, db) diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in index 5ae85a3a03..6f9b09c78a 100644 --- a/include/sys/fm/Makefile.in +++ b/include/sys/fm/Makefile.in @@ -198,6 +198,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in index 5976245d71..684930c7ff 100644 --- a/include/sys/fm/fs/Makefile.in +++ b/include/sys/fm/fs/Makefile.in @@ -158,6 +158,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in index 61f3125f4b..2aa6bb2aee 100644 --- a/include/sys/fs/Makefile.in +++ b/include/sys/fs/Makefile.in @@ -158,6 +158,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/Makefile.in b/lib/Makefile.in index f40801f661..a507886b90 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 5e31cc51aa..b4fc5cd87b 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -159,6 +159,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index a2f425530d..6329a7953e 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -159,6 +159,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 7732784837..374864432a 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -185,6 +185,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in index e1c1a2ce25..77bb89a56b 100644 --- a/lib/libshare/Makefile.in +++ b/lib/libshare/Makefile.in @@ -159,6 +159,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 2f94b5db61..22b9e5715e 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -210,6 +210,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index 66ec77b006..328d1104af 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -130,6 +130,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index 4c9f37fd38..794fda90b6 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -134,6 +134,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index 845e2ab90f..bce574f299 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -134,6 +134,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index d9f694485d..c5a949ffb4 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -194,6 +194,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index abb9a7b24c..7efb41e21e 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index a7e3f3cd97..f774123ce8 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -156,6 +156,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 6c3174da9b..8d08d442d7 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -156,6 +156,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index b226c8d4b7..4e94d4389b 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -194,6 +194,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index aa63471b76..2130c3b12d 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -156,6 +156,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index 29861385d8..533d5a54c9 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -156,6 +156,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index bb71a90d64..adbc3a7ff0 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -156,6 +156,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index 0b99b01a96..063ce39d00 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -159,6 +159,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index 5e87e01144..dbd6aa0359 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -188,6 +188,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 5fc0ed98ed..48202c07c2 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -189,6 +189,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index d357fdd9e7..09073fe330 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -201,6 +201,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/man/Makefile.in b/man/Makefile.in index fb691d05bf..aeac86d67f 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index c8f015d109..2871d4b3ce 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index 5f333ab96c..50207bdbb6 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -68,7 +68,7 @@ dmu_tx_create_dd(dsl_dir_t *dd) offsetof(dmu_tx_hold_t, txh_node)); list_create(&tx->tx_callbacks, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX refcount_create(&tx->tx_space_written); refcount_create(&tx->tx_space_freed); #endif @@ -141,7 +141,7 @@ dmu_tx_hold_object_impl(dmu_tx_t *tx, objset_t *os, uint64_t object, txh = kmem_zalloc(sizeof (dmu_tx_hold_t), KM_SLEEP); txh->txh_tx = tx; txh->txh_dnode = dn; -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX txh->txh_type = type; txh->txh_arg1 = arg1; txh->txh_arg2 = arg2; @@ -798,7 +798,7 @@ dmu_tx_holds(dmu_tx_t *tx, uint64_t object) return (holds); } -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX void dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db) { @@ -1004,7 +1004,7 @@ dmu_tx_try_assign(dmu_tx_t *tx, uint64_t txg_how) /* calculate memory footprint estimate */ memory = towrite + tooverwrite + tohold; -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX /* * Add in 'tohold' to account for our dirty holds on this memory * XXX - the "fudge" factor is to account for skipped blocks that @@ -1130,7 +1130,7 @@ dmu_tx_wait(dmu_tx_t *tx) void dmu_tx_willuse_space(dmu_tx_t *tx, int64_t delta) { -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX if (tx->tx_dir == NULL || delta == 0) return; @@ -1180,7 +1180,7 @@ dmu_tx_commit(dmu_tx_t *tx) list_destroy(&tx->tx_callbacks); list_destroy(&tx->tx_holds); -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX dprintf("towrite=%llu written=%llu tofree=%llu freed=%llu\n", tx->tx_space_towrite, refcount_count(&tx->tx_space_written), tx->tx_space_tofree, refcount_count(&tx->tx_space_freed)); @@ -1216,7 +1216,7 @@ dmu_tx_abort(dmu_tx_t *tx) list_destroy(&tx->tx_callbacks); list_destroy(&tx->tx_holds); -#ifdef ZFS_DEBUG +#ifdef DEBUG_DMU_TX refcount_destroy_many(&tx->tx_space_written, refcount_count(&tx->tx_space_written)); refcount_destroy_many(&tx->tx_space_freed, diff --git a/scripts/Makefile.in b/scripts/Makefile.in index c6a49f6c1e..a16ab5974c 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -194,6 +194,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in index 684530d427..bc0cee0c9d 100644 --- a/scripts/zpios-profile/Makefile.in +++ b/scripts/zpios-profile/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in index c9cb7c2ee2..54f55c62c7 100644 --- a/scripts/zpios-test/Makefile.in +++ b/scripts/zpios-test/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in index db4b29c3bf..22867ed1b7 100644 --- a/scripts/zpool-config/Makefile.in +++ b/scripts/zpool-config/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in index 036f48c3bc..54285b9f4c 100644 --- a/scripts/zpool-layout/Makefile.in +++ b/scripts/zpool-layout/Makefile.in @@ -154,6 +154,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/udev/Makefile.in b/udev/Makefile.in index 49ca53aa3a..9506bb96ea 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -169,6 +169,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in index 84693adba8..dbb126f5f5 100644 --- a/udev/rules.d/Makefile.in +++ b/udev/rules.d/Makefile.in @@ -153,6 +153,7 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEBUG_DMU_TX = @DEBUG_DMU_TX@ DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@ DEBUG_ZFS = @DEBUG_ZFS@ DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@ diff --git a/zfs-modules.spec.in b/zfs-modules.spec.in index f1db8c3a63..220b1c11ed 100644 --- a/zfs-modules.spec.in +++ b/zfs-modules.spec.in @@ -33,6 +33,17 @@ %endif %endif +# Set using 'rpmbuild ... --with debug-dmu-tx ...', defaults to disabled. +%if %{defined _with_debug_dmu_tx} + %define kdebug_dmu_tx --enable-debug-dmu-tx +%else + %if %{defined _without_debug_dmu_tx} + %define kdebug_dmu_tx --disable-debug-dmu-tx + %else + %define kdebug_dmu_tx --disable-debug-dmu-tx + %endif +%endif + # SLES: %if %{defined suse_version} %if %{undefined kver} @@ -264,7 +275,7 @@ which use %{name}. %build %configure --with-linux=%{kdir} --with-linux-obj=%{kobj} \ --with-spl=%{spldir} --with-spl-obj=%{splobj} \ - --with-config=kernel %{kdebug} + --with-config=kernel %{kdebug} %{kdebug_dmu_tx} make %install diff --git a/zfs_config.h.in b/zfs_config.h.in index 234e4e44ee..d398551229 100644 --- a/zfs_config.h.in +++ b/zfs_config.h.in @@ -1,5 +1,8 @@ /* zfs_config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 to enabled dmu tx validation */ +#undef DEBUG_DMU_TX + /* invalidate_bdev() wants 1 arg */ #undef HAVE_1ARG_INVALIDATE_BDEV